title: training unbalanced data in libsvm
body: <p>I have 25 classes and class 0 included all the the negative samples of all 24 other classes so the number of samples in this class is much more bigger than the others (e.g 10 times bigger because it should include all of the negative samples from the 24 other classes)</p>
  
  <p>Now my question is what should I do when I want to train this data set ?</p>
  
  <p>Do I <strong>have to</strong> use unbalaced training option which libsvm prodives ? -w0 1 -w1 .... </p>
  
  <p>I mean is it <strong>obligatory</strong> to use this option or not ?</p>
  
  <p>because When I'm training the data <strong>without this option</strong> it gives 99.8% accuracy for separating classes and when I'm testing this accurate  model !!! for some classes I get 100% accuracy and for some other classes I get 0.0%  !!!</p>
  
  <p>I mean for some classes it will not miss any sample but for another class it will always return 0 !!! which means it is a negative sample !!!</p>
  
  <p>I want to use this option but I dont know the rules for it. I mean How should I set a value for a class using this option?</p>
  
  <p>Suppose number of samples in each classes are :</p>
  
  <p>class 0 -> 3433</p>
  
  <p>class 1 -> 745</p>
  
  <p>class 2 -> 232</p>
  
  <p>class 3 -> 53</p>
  
  <p>.
  .
  .
  class 23 -> 975</p>
  
  <p>how should I set wi for each class should I scaled them between [0,1] or [-1 1] or (-inf +inf) or what ?</p>
  
  <p>Summary  ></p>
  
  <p>1). is it obligatory to use -wi option for my dataset ?</p>
  
  <p>2). how should I set this value </p>
  
  <p>Thanks</p>