Hopefully a simple question but incredibly annoying lack of information in the mlr3 book! So I have a tuned learner (regr.bart) that I want to simply set one hyperparameter to a fixed (not tuned) value. The param in question is 'verbose' which annoyingly is set to TRUE so I get flooded with stupid messages I do not want. I cannot find a simple example where I can set verbose to FALSE. Please help.
1 Answer
library(mlr3tuning)
learner = lrn("classif.rpart", cp = to_tune(0.001, 0.1), keep_model = FALSE)
tune(
method = "random_search",
task = tsk("pima"),
learner = learner,
resampling = rsmp("cv", folds = 3),
measure = msr("classif.ce"),
term_evals = 10,
batch_size = 5
)
or
library(mlr3tuning)
search_space = ps(
cp = p_dbl(lower = 0.001, upper = 0.1)
)
learner = lrn("classif.rpart")
learner$param_set$values$keep_model = FALSE
tune(
method = "random_search",
task = tsk("pima"),
learner = learner,
resampling = rsmp("cv", folds = 3),
measure = msr("classif.ce"),
term_evals = 10,
search_space = search_space,
batch_size = 5
)
1 Comment
S. Robinson
Is there a way to assign the
search_space ParamSet to the learner directly, rather than having it as an argument within tune()? I've tried learner$param_set$set_values(search_space) and wanted a list object, not a ParamSet object