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 Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by