필터 지우기
필터 지우기

WOit gives me error says un recognized variable GWO

조회 수: 2 (최근 30일)
essrra
essrra 2023년 3월 10일
답변: Walter Roberson 2023년 3월 10일
clc;
clear;
global A trn vald ;
T=100;
N=30;
lb=0;%
ub=1;
runs=30;
threshold=2;
fitfun=@AccSz; %fitness function 0.99Err+0.01*Selection Ratio
%% Problem Definition
fn={'arrhythmia','primary-tumor','australian','base_Brain_T91','hepatitis','horse-colic',...
'KrvskpEW','BreastEW','spambase','SportsArticles','WaveformEW',...
'WineEW','Zoo','CongressEW','Exactly','Exactly2','HeartEW','IonosphereEW','Lymphography'...
'M-of-n','PenglungEW','SonarEW','SpectEW','Vote'};
SD=size(fn,1);
for j=1:SD
libb=['BDD\' cell2mat(fn(j)) '.mat'];
% A=load('C:\Users\d\Downloads\archieve');
% save('featuresall.mat')
load('f')
A=featuresall;
nVar=size(featuresall,2)-1;
r=randperm(size(featuresall,1));
trn=r(1:floor(length(r)*0.8)); % split 80% train 20% test not k-fold
vald=r(floor(length(r)*0.8)+1:end);
dim=nVar;
for i=1:runs
display(['At run ', num2str(i)]);
[t_GWO(i),Nf_GWO(i),outcome_GWO(i), best_GWO(i,:),GWO_conv(i,:)]=GWO(N,T,lb,ub,dim,fitfun);
[acc_GWO(i),sensi_GWO(i),speci_GWO(i)]=ACC(best_GWO(i,:));
end
str=(strcat(char(fn{j}),'_',num2str(1)));
save(str)
end
v
  댓글 수: 8
Jan
Jan 2023년 3월 10일
Post the code and a copy of the complete error message.
essrra
essrra 2023년 3월 10일
편집: essrra 2023년 3월 10일
function GWO
end
Error using GWO
Too many input arguments.
Error in MAIN (line 36)
[t_GWO(i),Nf_GWO(i),outcome_GWO(i), best_GWO(i,:),GWO_conv(i,:)]=GWO(N,T,lb,ub,dim,fitfun);

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 3월 10일
https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo needs to be installed. You can use the Add-on Explorer to do that.

카테고리

Help CenterFile Exchange에서 Classification Trees에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by