Error using ELM Too many input arguments.

please help me to fix this code:
clc;
clear;
close all;
%TRAINING PROCESS EXTREME LEARNING MACHINE
%Mengambil Data Latih Bentuk
dt_bentuk = xlsread('inputbentuk.xls');
%Menentukan Parameter dan Kelas Target Data Latih
x1=dt_bentuk(:,1:8); %Parameter
t1=dt_bentuk(:,9); %Kelas
%Menyusun Data Latih
data_training = [x1,t1];
%Menyusun Parameter ELM
NumberofInputNeurons = 8;
NumberofHiddenNeurons = 200;
% bobot diinisialisasi secara random
InputWeight = rand(NumberofHiddenNeurons,NumberofInputNeurons)*2-1;
BiasofHiddenNeurons = rand(NumberofHiddenNeurons,1);
% bobot ditetapkan di awal
load bobotawal
Elm_Type = 1;
ActivationFunction = 'sin';
% pelatihan elm
[~, ~, ~, ~, predicted_class] = ...
ELM(data_training, data_training, ...
InputWeight, BiasofHiddenNeurons, Elm_Type,...
ActivationFunction);
% menghitung akurasi pelatihan
[~,n] = find(predicted_class==kelas);
akurasi = numel(n)/jumlah_file*100;
disp(['akurasi pelatihan = ',num2str(akurasi),'%'])
% menyimpan variabel2 pelatihan
save('net','data_training','InputWeight','BiasofHiddenNeurons',...
'Elm_Type','ActivationFunction')

回答(1 个)

I assume you are using ELM.m from here:
Note that that function takes five inputs:
% TrainingData_File - Filename of training data set
% TestingData_File - Filename of testing data set
% Elm_Type - 0 for regression; 1 for (both binary and multi-classes) classification
% NumberofHiddenNeurons - Number of hidden neurons assigned to the ELM
% ActivationFunction - Type of activation function:
% 'sig' for Sigmoidal function
% 'sin' for Sine function
% 'hardlim' for Hardlim function
% 'tribas' for Triangular basis function
% 'radbas' for Radial basis function (for additive type of SLFNs instead of RBF type of SLFNs)
And you have given it six inputs:
[~, ~, ~, ~, predicted_class] = ...
ELM(data_training, data_training, ... % 1 and 2 (both identical)
InputWeight, BiasofHiddenNeurons, Elm_Type,... % 3, 4 and 5
ActivationFunction); % 6
Check the inputs you are giving ELM.m.

类别

帮助中心File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

产品

版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by