SVM train and Classification Errors

3 vues (au cours des 30 derniers jours)
Krishna Ganesh
Krishna Ganesh le 22 Avr 2019
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 :)

Réponses (2)

Alan Weiss
Alan Weiss le 23 Avr 2019
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 le 10 Déc 2020
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

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by