I am trying to run an SVM on an imbalanced dataset (0-90%, 1-10%) using the e1071 package, with the radial kernel. I am using cross-validation to select the best gamma and cost. Additionally, I want to use class weights ("0"=1, "1"=10) for every model.
This is the code I am using (similar to the one used in ISLR, only with class weights) with 5 gamma values and 5 cost parameters. Instead of getting 25 models in the output, I am getting 5. The cost parameter is not getting accounted for:
The best model output is the following:
What is the best way to tune the parameters (gamma and cost), including the class weights?
This is my first time running svm. This code took more than 2 days to run. Where am I going wrong?