SVM classification for healthy a

2 views (last 30 days)
Vania krm
Vania krm on 17 May 2019
segmented_features=sFeat;
%Feature reduction using PCA
[coeff,G,latent]=pca(segmented_features); %score==G mxn
%traindata
xdata=G(1:60,:);
group_label=label(1:60,:);
group_label=double(group_label);
%testdata
xtdata=G(61:100,:);
groupt_label=double(label(61:100,:));
%SVM
svmStruct1 = svmtrain(xdata,group_label);
species = svmclassify(svmStruct1,xtdata);
Why in this code my SVM does not work and I have these errors:
Reference to non-existent field 'SupportVectors'.
Error in svmclassify (line 60)
if size(sample,2)~=size(svmStruct.SupportVectors,2)
Error in Both3march (line 17)
species = svmclassify(svmStruct1,xtdata);
when I check the svmStruct1= number of classes are recognised 60 instead of 2! can any one help me.

Answers (0)

Categories

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

Tags

Products

Community Treasure Hunt

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

Start Hunting!