[R] Question about framework to weighting different classes in SVM

adschai at optonline.net adschai at optonline.net
Thu Jul 5 04:56:24 CEST 2007


Hi gurus,

I have a doubt about multiclass classification SVM. The population in my data includes a couple of class labels that have relatively small proportion of the entire population compared to other classes. I would like SVM to pay more attention to these classes. However, the question I am having here is that is there any systematic/theoretic framework to determine the weights for each class? 

My second question is directly related to R. I would like to use the class.weights attribute in svm function. However, I'm quite confused a bit about how to use it from the description I got from ?svm. Below is the quote.

'a named vector of weights for the different classes, used for asymetric class sizes. Not all factor levels have to be supplied (default weight: 1). All components have to be named.'

Is the name of the vector has to match the levels in my factor used as target labels for my classification? Any simple example would be really appreciated. Thank you!

- adschai



More information about the R-help mailing list