I know that the SVM is a binary classifier. I would like to extend it to multi-class SVM. Which is the best, and maybe the easiest, way to perform it?
code: in MATLAB
u=unique(TrainLabel);
N=length(u);
if(N>2)
itr=1;
classes=0;
while((classes~=1)&&(itr<=length(u)))
c1=(TrainLabel==u(itr));
newClass=double(c1);
tst = double((TestLabel == itr));
model = svmtrain(newClass, TrainVec, '-c 1 -g 0.00154');
[predict_label, accuracy, dec_values] = svmpredict(tst, TestVec, model);
itr=itr+1;
end
itr=itr-1;
end
How can this be improved?