Error on Kernel_Function is not a valid parameter name.

10 ビュー (過去 30 日間)
Shindujah Arudchelvan
Shindujah Arudchelvan 2021 年 6 月 30 日
コメント済み: Image Analyst 2021 年 6 月 30 日
function [itr] = multisvm( T,C,tst )
u=unique(C);
N=length(u);
c4=[];
c3=[];
j=1;
k=1;
if(N>2)
itr=1;
classes=0;
cond=max(C)-min(C);
while((classes~=1)&&(itr<=length(u))&& size(C,2)>1 && cond>0)
c1=(C==u(itr));
newClass=c1;
svmStruct = fitcsvm (T,newClass,'Kernel_Function','rbf','Method','QP');
classes = ClassificationSVM(svmStruct,tst);
for i=1:size(newClass,2)
if newClass(1,i)==0;
c3(k,:)=T(i,:);
k=k+1;
end
end
T=c3;
c3=[];
k=1;
% This is the loop for reduction of group
for i=1:size(newClass,2)
if newClass(1,i)==0;
c4(1,j)=C(1,i);
j=j+1;
end
end
C=c4;
c4=[];
j=1;
cond=max(C)-min(C);
if classes~=1
itr=itr+1;
end
end
end
end
Why am i getting error on Kernel_Function is not a valid parameter name.?
error line>>
svmStruct = fitcsvm (T,newClass,'Kernel_Function','rbf','Method','QP');

採用された回答

Image Analyst
Image Analyst 2021 年 6 月 30 日
Recheck the documentation for fitcsvm. There is no underline in the name of the KernelFunction option. To fix:
svmStruct = fitcsvm (T, newClass, 'KernelFunction', 'rbf',' Method', 'QP');
  2 件のコメント
Shindujah Arudchelvan
Shindujah Arudchelvan 2021 年 6 月 30 日
Thanks for answering, I Fixed that error but now Its say Error on "Method is not a valid parameter name." Why is that?
Image Analyst
Image Analyst 2021 年 6 月 30 日
I'm not seeing 'Method" as one of the available Name, Value pairs you can pick from. Why do you think it is?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClassification Learner App についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by