My project is acute stroke classification using SVM classifier in MATLAB.
The screenshot below shows the 13 feature extraction of acute stroke (21 patients) and normal brain (6 patients) using glcm which is known as training data for svm classifier.
The following screenshot shows Y
or group of training data.
This is the code that I am using and its shows error.
Load Trainset.mat
data = new_var;
group = label;
SVMStruct = svmtrain(data, group, 'kernel_function', 'linear');
newClasses = svmclassify(SVMStruct, texturedata, 'showplot', true);
%To plot classification graphs, SVM can take only two dimensional data
data1 = [new_var(:, 1), new_var(:, 2)];
newfeat = [texturedata(:, 1), texturedata(:, 2)];
SVMStruct_new =
svmtrain(data, group, 'kernel_function', 'linear', 'showplot', true);
%species_Linear_new = svmclassify(SVMStruct_new, newfeat, 'showplot', true);
Warning: Y contains categorical levels that don't appear in the elements of Y. Those levels will be ignored for the purposes of training the classifier. In svmtrain at 277
Error using svmtrain (line 335) Y must contain exactly two groups for method 'SMO'.
I think it's because the value 0
and NAN
for normal brain that the row being ignore. So my question is: what should I do to include that row or maybe it absolutely doesn't work for this code?