I'm using the R package caret to generate classifiers using a variety of different models on an imbalanced dataset. To overcome the class imbalance problem, I am using the "weights" parameter in the "train" function. This seems to work for some models, but not for others. If I set the weights equal, the rpart classifier, for example, predicts 20% class 1 and 80% class 2, which is very close to my observed class proportions. Setting the weights to 10 and 1, the classifier now predicts class 1 in over 90% of examples, and only 10% class 2.
However, when using the svmLinear, svmRadial, or rf algorithms, the weights parameter has no effect. No matter what class weights I input, the classifiers invariably label 20% as class 1 and 80% as class 2. Looking into the code a little more, it doesn't appear that the "weights" parameter from the "train" function ever gets passed through to the call to the ksvm package, which is what caret uses for SVM training.
This link has an example using the svmLinear method in caret, and changing the weight vector does absolutely nothing.
Has anyone else experienced this problem? Is there any way to determine which models actually accept class weights as an input?