I am trying to optimize an SVR model within the mlr3 ecosystem with the kernlab
package and I am getting the following error:
The parameter 'C' can only be set if the following condition is met 'type <U+2208> {eps-svr, eps-bsvr}'. Instead the current parameter value is: type=nu-svr.
I find it very weird that cost parameter C cannot be optimized for type 'nu-svr'.
This is a part of my code:
library(mlr3tuning)
learner_ksvm$param_set
search_space = ps(
C = p_dbl(lower = 0.01, upper = 1),
type = p_fct(levels = c("eps-svr", "nu-svr")),
epsilon = p_dbl(lower = 0.01, upper = 1)
)
measure = msr("regr.rmse")
terminator = trm("evals", n_evals = 10)
instance = TuningInstanceSingleCrit$new(
task = task_train_prerp,
learner = learner_ksvm,
resampling = rsmp_cv,
measure = measure,
search_space = search_space,
terminator = terminator
)
tuner = tnr("random_search")
library(progressr)
handlers(global = TRUE)
handlers("rstudio")
tuner$optimize(instance)