classificationSVM and fitcsvm error for SVM model

I am getting this error while trying to train SVM model
Error using ClassificationSVM (line 249)
Use fitcsvm to train an SVM model.
Error in multisvm (line 29)
classes = ClassificationSVM(svmStruct,tst);
Error in DetectDisease_GUI>pushbutton6_Callback (line 326)
result = multisvm(Train_Feat,Train_Label,test);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in DetectDisease_GUI (line 41)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)DetectDisease_GUI('pushbutton6_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Can anyone help me to resolve this errors!

답변 (2개)

Abhirami Manikandan
Abhirami Manikandan 2020년 6월 17일

0 개 추천

Machine Learning
Functionality Being Removed or Changed
classregtree has been removed
svmtrain and svmclassify have been removed
The svmtrain and svmclassify functions have been removed. Use the fitcsvm function and the predict function of ClassificationSVM instead.To update your code, replace all instances of svmtrain with fitcsvm, and replace all instances of svmclassify with predict. For more details, see the Compatibility Considerations sections of svmtrain and svmclassify

댓글 수: 4

SVMmodel=fitcsvm(Training,class);
result = ClassificationSVM(SVMmodel, TestSet);
Error using ClassificationSVM (line 249)
Use fitcsvm to train an SVM model.
Hi @Abhirami,
I used fitcsvm for training but still i get the same error message.
SVMmodel = fitcsvm(Training,class);
result = predict(SVMmodel, TestSet);
Now compare result to the known targets for TestSet in order to determine performance metrics.
Hi Walter,
It worked perfectly now. Thanks a lot.
Thanks Walter, you helped a lot.
Thanks Warid as well.

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

질문:

2019년 3월 29일

댓글:

2020년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by