title: MultiClass using LIBSVM
body: <p>I have a multiclass svm classification(6 class). I would like to classify it using LIBSVM. The following are the ones that i have tried and i have some questions regarding them. </p>
  
  <p>Method1( one vs one): </p>
  
  <pre><code>model = svmtrain(TrainLabel, TrainVec, '-c 1 -g 0.00154 -b 0.9');
  [predict_label, accuracy, dec_values] = svmpredict(TestLabel, TestVec, model);
  </code></pre>
  
  <p>Two questions about this method: 1) is that all i need to do for multiclass problem
  2) what value should it be for n in '-b n'. I m not sure</p>
  
  <p>Method 2( one vs rest):</p>
  
  <pre><code>u=unique(TrainLabel); 
  N=length(u); 
  if(N&gt;2)    
      itr=1;    
      classes=0;   
      while((classes~=1)&amp;&amp;(itr&lt;=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
  </code></pre>
  
  <p>For the second method,how do I attach classification scores. I am not able to do voting.</p>
  
  <p>Besides that,these are the two methods I have tried. Which method is better? </p>
  
  <p>Would like to hear some comments. Please correct me if I am wrong.</p>