"SVM class weights, unexpected results."

dragoljub
dragoljub New Altair Community Member
edited November 5 in Community Q&A
Hey Guys,

I have been exploring using different class weights in LibSVM for a binary classification problem with 2000 (-1) samples and 5000 (+1) samples. In the literature it seems that setting the ratio of complexity factors to C+1 : C-1 = (-1) : (+1) = 2:5 will result in a balanced number of support vectors between the two classes. Unfortunately no matter what I set my class weights to the support vector ratio is always imbalanced. Ideally I would like to have the same ratio of support vectors for both classes despite having a class imbalance in the training data.

Any Ideas?  ???

Also, I noticed that the 'SVM' (not libsvm) operator has a balance cost option, however the model summary returns the number of support vectors incorrectly, namely it counts each training sample as a support vector even though in the support vector table there are clearly many non support vectors.  :P

Thanks,
-Gagi

Answers

  • land
    land New Altair Community Member
    Hi Gagi,
    I'm not too familiar with the implementations, but might it be that each support vector will receive a lower weight? So that the count might be greater, but the weight sums equally among the classes.

    Greetings,
      Sebastian