Not enough input arguments

조회 수: 1 (최근 30일)
Feyza Zehra Asik
Feyza Zehra Asik 2021년 10월 16일
답변: yanqi liu 2021년 12월 27일
I'm very new to MATLAB and I am having some trouble. It says error using predict (line 70) Not enough input arguments. It gives this error for line [c_matrix,Result,RefereceResult]= confusion.getMatrix(actual,predict);
load veri.mat
load etiket.mat
figure;
plot(veri(1,:))
%özellik çıkarımı
for i=1:length(etiket)
x=veri(i,:);
ozellik(1,i)=(1/length(x))*sum(x.^2); %enerji
ozellik(2,i)=std(x); %standart
ozellik(3,i)=mean(abs(x)); %mutlak değerin ortalamaası
ozellik(4,i)=skewness(x); %agirlik
ozellik(5,i)=kurtosis(x); %basiklik
end
%4 katli capraz doğrulama
fold=cvpartition(etiket, 'kfold',4);
label=etiket;
%egitim ve test idelerinin ayrilmasi
trainIdx=fold.training(1); testIdx=fold.test(1);
%egitim verisinin ayrilmasi
Xtrain=ozellik(:,trainIdx); Ytrain=label(trainIdx);
%test verisinin ayrilmasi
Xtest=ozellik(:,testIdx); Ytest=label(testIdx);
%DVM Tasarımı
%cekridek fonksiyonu seçimi
t= templateSVM('Standardize',true, 'KernelFunction','gaussian');
%model eğitim
giris=transpose(Xtrain);
SVMModel = fitcecoc(giris,Ytrain,'Learners',t,'FitPosterior',true,...
'Classnames', {'Sag','Swell', 'Flicker'})
%model test islemi
predict_label = predict(SVMModel,transpose(Xtest));
predict_label = (categorical(cellstr(predict_label)));
for i=1: length(Ytest)
if Ytest(i,1)=='sag'
actual(1,i)=1;
end
if Ytest(i,1)=='Swell'
actual(1,i)=2;
end
if Ytest(i,1)=='Flicker'
actual(1,i)=3;
end
i
end
[c_matrix,Result,RefereceResult]= confusion.getMatrix(actual,predict);
%es olusum matrisinin gösterimi
figure;
cm= confusionchart(Ytest, predict_label,'RowSummary','row-normalized','ColumnSummary','column-normalized');
cm.Title = 'Test Verisi İcin Es Olusum Matrisi';

답변 (2개)

Yongjian Feng
Yongjian Feng 2021년 12월 3일
What is confusion.getMatrix? The built-in confusion is a function. There is another confusionmat, but the return arguments don't match yours.

yanqi liu
yanqi liu 2021년 12월 27일
yes,sir,may be use
[c_matrix,Result,RefereceResult]= confusion(actual,predict_label);

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by