# Voting in Multi-Class SVM [duplicate]

I am currently trying to classify 6 class of facial expression using SVM. I am using MATLAB and LIBSVM to do my classification.

The problem i face is the pred label below produces 0 and 1. It treats it as binary classifer. I am able to do multi-class svm but there is one more step that is voting or sum-pooling which i am not sure how to do it. Need some help in it.

Code:

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


Any help is appreciated

• Isn't it actually a programming-in-MATLAB problem? If so, it should rather go to SO... If you agree, I'll migrate it. – user88 Feb 21 '12 at 0:08

No, you won't get single svmtrain output to be anything but binary.