clbk("mlr3tuning.one_se_rule")
# Run optimization on the pima data set with the callback
instance = tune(
tuner = tnr("random_search", batch_size = 15),
task = tsk("pima"),
learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)),
resampling = rsmp("cv", folds = 3),
measures = msr("classif.ce"),
term_evals = 30,
callbacks = clbk("mlr3tuning.one_se_rule")
)
# Hyperparameter configuration with the smallest feature set within one standard error of the best
instance$result
Run the code above in your browser using DataLab