Too many input arguments.

조회 수: 2 (최근 30일)
sun rise
sun rise 2021년 10월 1일
댓글: Walter Roberson 2021년 10월 2일
function [result] = multisvm(TrainingSet,Group_Train1,TestSet,Group_Test1)
%Models a given training set with a corresponding group vector and
%classifies a given test set using an SVM classifier according to a
%one vs. all relation.
%
%This code was written by Cody Neuburger cneuburg@fau.edu
%Florida Atlantic University, Florida USA...
%This code was adapted and cleaned from Anand Mishra's multisvm function
%found at http://www.mathworks.com/matlabcentral/fileexchange/33170-multi-class-support-vector-machine/
%GroupTrain=GroupTrain';
u=unique(Group_Train1);
numClasses=length(u);
%TestSet=TestSet';
%TrainingSet=TrainingSet';
result = categorical.empty();
%build models
models = cell(numClasses,1);
for k=1:numClasses
%Vectorized statement that binarizes Group
%where 1 is the current class and 0 is all other classes
G1vAll=(Group_Train1==u(k));
%models{k} = fitcsvm(TrainingSet,G1vAll);
models{k} = fitcsvm(TrainingSet,G1vAll,'KernelFunction','polynomial','polynomialorder',3,'Solver','ISDA','Verbose',0,'Standardize',true);
if ~models{k}.ConvergenceInfo.Converged
fprintf('Training did not converge for class "%s"\n', string(u(k)));
end
end
%classify test cases
for t=1:size(TestSet,1)
matched = false;
for d=1:numClasses
if(predict(models{d},TestSet(t,: )))
matched = true;
break;
end
end
if matched
result(t,1) = u(d);
else
result(t,1) = 'No Match';
end
%--------------------------------
end
Accuracy = mean(Group_Test1==result) * 100;
fprintf('Accuracy = %.2f\n', Accuracy);
fprintf('error rate = %.2f\n ', mean(result ~= Group_Test1 ) * 100);
HOG2
load featurs_T
load featurs_S
load Group_Train
load Group_Test
result1= multisvm(TrainingSet,Group_Train1,TestSet,Group_Test1);
testresult = result1;
Error using multisvm
Too many input arguments.
Error in HOG2 (line 30)
result1= multisvm(TrainingSet,Group_Train1,TestSet,Group_Test1);
  댓글 수: 3
sun rise
sun rise 2021년 10월 1일
How can i get rid of it
Walter Roberson
Walter Roberson 2021년 10월 2일
Put this multisvm into the current directory.

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

답변 (0개)

카테고리

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

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by