Skip to content
Prev 60050 / 398502 Next

tune()

Sending a help request once is enough! Even if you don't have an answer
after 1 hour.
I think you want to set `kernel' not `type'...
...checking the argument `type' on ?svm would have told you that.
Surprisingly, you have to set `ranges' to specify the ranges of the
parameters, e.g.,

  obj <- tune(svm, Species ~ ., data = iris,
              ranges = list(degree =2^(1:2), gamma = 2^(-1:1),
                            coef0 = 2^(-1:1), cost = 2^(2:4)),
              kernel = "polynomial")

I'm not sure what good ranges are to tune an SVM with a polynomial
kernel...

hth,
Z