mlr-org / mlr3learners

Recommended learners for mlr3
https://mlr3learners.mlr-org.com
GNU Lesser General Public License v3.0
91 stars 16 forks source link

Possible bug: Can't set parameter C in learner 'regr.svm' for nu-regression #207

Closed edsantor closed 3 years ago

edsantor commented 3 years ago

I report that it is not possible to set the parameter 'cost' in a learner 'regr.svm' when 'type = nu-regression'. The following error message appears:

learner_svm = lrn("regr.svm")

learner_svm$param_set$values = list(
  cost = 1000,
  type = "nu-regression",
  kernel = "radial",
  gamma = 1,
  nu = 0.1
)
Error in self$assert(xs) : 
  Assertion on 'xs' failed: The parameter 'cost' can only be set if the following condition is met 'type = eps-regression'. Instead the current parameter value is: type=nu-regression.

I consider this fact to be an error since the parameter C also appears in the mathematical definition of nu-SVR.

In addition, it is possible to set the parameter 'cost' (C) directly using the e1071 package for 'nu-regression'. The same error appears with the learner 'regr.ksvm' from the kernlab package.

larskotthoff commented 3 years ago

@edsantor It looks like this isn't supported in the underlying package, i.e. there's nothing we can do about it in mlr/mlr3. Feel free to reopen if I'm mistaken, but this would be an issue to raise with the kernlab developers.