library(mlr3learners)
task = tsk("iris")
measure = msr("classif.ce")
resampling = rsmp("holdout")
learner = lrn("classif.svm", kernel = "polynomial")
tune_ps = ParamSet$new(list(
ParamInt$new("degree", lower = 1, upper = 8)))
evals20 = trm("evals", n_evals = 20)
instance = TuningInstanceSingleCrit$new(task, learner, resampling, measure, tune_ps, evals20)
tuner = tnr("random_search")
tuner$optimize(instance)
> Error in lapply(xss, self$domain$assert) :
Assertion on 'X[[i]]' failed: The parameter 'degree' can only be set if the following condition is met 'kernel = polynomial'. Instead the parameter value for 'kernel' is not set at all. Try setting 'kernel' to a value that satisfies the condition.
We add kernel = "polynomial"to the parameter set in .eval_many in mlr3tuning::ObjectiveTuning before the evaluation but the domain is already checked for dependencies in eval_many in bbotk::Objective.
We should change the default of check_values to FALSE in mlr3tuning::TuningInstanceSingleCrit to disable the domain checks.
If the user really wants the checks, he has to use a trafo like this
The following code does not work anymore
We add
kernel = "polynomial"
to the parameter set in.eval_many
inmlr3tuning::ObjectiveTuning
before the evaluation but the domain is already checked for dependencies ineval_many
inbbotk::Objective
.We should change the default of
check_values
toFALSE
inmlr3tuning::TuningInstanceSingleCrit
to disable the domain checks.If the user really wants the checks, he has to use a trafo like this