mlr_tuners_internal {mlr3tuning} | R Documentation |
Hyperparameter Tuning with Internal Tuning
Description
Subclass to conduct only internal hyperparameter tuning for a mlr3::Learner.
Dictionary
This Tuner can be instantiated with the associated sugar function tnr()
:
tnr("internal")
Progress Bars
$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")
.
Logging
All Tuners use a logger (as implemented in lgr) from package
bbotk.
Use lgr::get_logger("bbotk")
to access and control the logger.
Resources
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.
Super classes
mlr3tuning::Tuner
-> mlr3tuning::TunerBatch
-> TunerBatchInternal
Methods
Public methods
Inherited methods
Method new()
Creates a new instance of this R6 class.
Usage
TunerBatchInternal$new()
Method clone()
The objects of this class are cloneable with this method.
Usage
TunerBatchInternal$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Note
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.
See Also
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
Examples
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"
)
# Internal hyperparameter tuning on the pima indians diabetes data set
instance = tune(
tnr("internal"),
tsk("iris"),
learner,
rsmp("cv", folds = 3),
msr("classif.ce")
)
# best performing hyperparameter configuration
instance$result_learner_param_vals
instance$result_learner_param_vals$internal_tuned_values