mlr_tuners_internal | R Documentation |
Subclass to conduct only internal hyperparameter tuning for a mlr3::Learner.
This Tuner can be instantiated with the associated sugar function tnr()
:
tnr("internal")
$optimize()
supports progress bars via the package progressr
combined with a bbotk::Terminator. Simply wrap the function in
progressr::with_progress()
to enable them. We recommend to use package
progress as backend; enable with progressr::handlers("progress")
.
All Tuners use a logger (as implemented in lgr) from package
bbotk.
Use lgr::get_logger("bbotk")
to access and control the logger.
There are several sections about hyperparameter optimization in the mlr3book.
The gallery features a collection of case studies and demos about optimization.
Use the Hyperband optimizer with different budget parameters.
mlr3tuning::Tuner
-> mlr3tuning::TunerBatch
-> TunerBatchInternal
new()
Creates a new instance of this R6 class.
TunerBatchInternal$new()
clone()
The objects of this class are cloneable with this method.
TunerBatchInternal$clone(deep = FALSE)
deep
Whether to make a deep clone.
The selected mlr3::Measure does not influence the tuning result. To change the loss-function for the internal tuning, consult the hyperparameter documentation of the tuned mlr3::Learner.
Other Tuner:
Tuner
,
mlr_tuners
,
mlr_tuners_cmaes
,
mlr_tuners_design_points
,
mlr_tuners_gensa
,
mlr_tuners_grid_search
,
mlr_tuners_irace
,
mlr_tuners_nloptr
,
mlr_tuners_random_search
library(mlr3learners)
# Retrieve task
task = tsk("pima")
# Load learner and set search space
learner = lrn("classif.xgboost",
nrounds = to_tune(upper = 1000, internal = TRUE),
early_stopping_rounds = 10,
validate = "test",
eval_metric = "merror"
)
# Internal hyperparameter tuning on the pima indians diabetes data set
instance = tune(
tnr("internal"),
tsk("iris"),
learner,
rsmp("cv", folds = 3),
msr("internal_valid_score", minimize = TRUE, select = "merror")
)
# best performing hyperparameter configuration
instance$result_learner_param_vals
instance$result_learner_param_vals$internal_tuned_values
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.