Reputation: 28022
I am using LibSVM to train SVM on a highly imbalanced data set. 10% of the output is true while 90% is false. I read about weight parameter:
-wi weight: set the parameter C of class i to weight*C, for C-SVC (default 1)
What should be the parameter set for each of the class? What does this weight parameter mean intuitively and how should we use it?
Upvotes: 3
Views: 2826
Reputation: 109262
The weight parameter controls the skewedness of the SVM optimisation. That is, classes with a higher weight will count more. If the weight for a class is 3 times as much as for another, an instance of the class of the lower weight can be 3 times as far away from the boundary between the classes that libsvm determines as an instance of the other class to get the same optimisation value.
How you use this is entirely up to you -- you could set it such that the two classes are equally weighted (i.e. a weight of 9 for true), but if the results you get with this actually improve on using the same weights is a different matter.
I'd suggest that you play around with different weights to see what happens.
Upvotes: 4