mlr3tuning.one_se_rule | R Documentation |
The one standard error rule takes the number of features into account when selecting the best hyperparameter configuration.
Many learners support internal feature selection, which can be accessed via $selected_features()
.
The callback selects the hyperparameter configuration with the smallest feature set within one standard error of the best performing configuration.
If there are multiple such hyperparameter configurations with the same number of features, the first one is selected.
Kuhn, Max, Johnson, Kjell (2013). “Applied Predictive Modeling.” In chapter Over-Fitting and Model Tuning, 61–92. Springer New York, New York, NY. ISBN 978-1-4614-6849-3.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.