How to make SVM with three group or multiple class

i want make classification SVM with 3 group. but i know classification SVM only match for 2 group or class. There is a way that can make SVM classification with 3 group or class? This is my code :
GLCM2 = graycomatrix(I3,'Offset',[4 4]);
stats = graycoprops(GLCM2,{'contrast','homogeneity','energy','Correlation'})
a = stats.Contrast;
b = stats.Correlation;
c = stats.Energy;
d = stats.Homogeneity;
set(handles.edit1, 'String',a);
set(handles.edit2, 'String',b);
set(handles.edit3, 'String',c);
set(handles.edit4, 'String',d);
load class_uji2.txt;// document text class or group with three class {0,1,2}
load data_uji2.txt;// document text data glcm result
uji1=data_uji2(:,1:2:3:4);
massa = svmtrain(uji1,class_uji2)
uji = svmclassify(massa, [a b c d])
if uji == 0
hasil = 'Normal'
else if uji == 1
hasil = 'Biasa'
else
hasil = 'kanker'
end
end
set(handles.edit5, 'String',hasil);

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!