SVM train and Classification Errors

조회 수: 2 (최근 30일)
Krishna Ganesh
Krishna Ganesh 2019년 4월 22일
답변: Furkan DEMIR 2020년 12월 10일
Hello Everyone im getting this weird error while im using svm train and classificationSvm. Need some help fixing it as i am new to this
Code Block: load Trainset.mat
xdata = meas;
group = label;
svmStruct = fitcsvm(xdata,group,'HyperparameterOptimizationOptions', struct('showplot',true), 'KernelFunction','rbf','KernelScale',0.5);
species = ClassificationSVM(svmStruct,feat,'showplot',true);
if strcmpi(species,'MALIGNANT')
helpdlg(' Malignant Tumor ');
disp(' Malignant Tumor ');
else
helpdlg(' Benign Tumor ');
disp(' Benign Tumor ');
end
set(handles.edit18,'string', species);
and the errors are
Error using ClassificationSVM (line 249)
Use fitcsvm to train an SVM model.
Error in untitled2>pushbutton12_Callback (line 615)
species = ClassificationSVM(svmStruct,feat,'showplot',true);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in untitled2 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)untitled2('pushbutton12_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
Anybody has any idea in what im doing wrong? any help will be appreciated :)

답변 (2개)

Alan Weiss
Alan Weiss 2019년 4월 23일
Try removing the line
species = ClassificationSVM(svmStruct,feat,'showplot',true);
To learn how to use the resulting SVM, see the documentation for fitcsvm.
Alan Weiss
MATLAB mathematical toolbox documentation

Furkan DEMIR
Furkan DEMIR 2020년 12월 10일
Hello.
load Trainset.mat has two file. one of these meas and label.
When I see meas files. I saw 20*13 matrix. what is the meaning. Why the file is 20*13 matrix

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by