ti_async | R Documentation |
Function to construct a TuningInstanceAsyncSingleCrit or TuningInstanceAsyncMultiCrit.
ti_async(
task,
learner,
resampling,
measures = NULL,
terminator,
search_space = NULL,
store_benchmark_result = TRUE,
store_models = FALSE,
check_values = FALSE,
callbacks = NULL,
rush = NULL
)
task |
(mlr3::Task) |
learner |
(mlr3::Learner) |
resampling |
(mlr3::Resampling) |
measures |
(mlr3::Measure or list of mlr3::Measure) |
terminator |
(bbotk::Terminator) |
search_space |
(paradox::ParamSet) |
store_benchmark_result |
( |
store_models |
( |
check_values |
( |
callbacks |
(list of mlr3misc::Callback) |
rush |
( |
There are several sections about hyperparameter optimization in the mlr3book.
Getting started with hyperparameter optimization.
An overview of all tuners can be found on our website.
Tune a support vector machine on the Sonar data set.
Learn about tuning spaces.
Estimate the model performance with nested resampling.
Learn about multi-objective optimization.
Simultaneously optimize hyperparameters and use early stopping with XGBoost.
Automate the tuning.
The gallery features a collection of case studies and demos about optimization.
Learn more advanced methods with the Practical Tuning Series.
Learn about hotstarting models.
Run the default hyperparameter configuration of learners as a baseline.
Use the Hyperband optimizer with different budget parameters.
The cheatsheet summarizes the most important functions of mlr3tuning.
If no measure is passed, the default measure is used. The default measure depends on the task type.
Task | Default Measure | Package |
"classif" | "classif.ce" | mlr3 |
"regr" | "regr.mse" | mlr3 |
"surv" | "surv.cindex" | mlr3proba |
"dens" | "dens.logloss" | mlr3proba |
"classif_st" | "classif.ce" | mlr3spatial |
"regr_st" | "regr.mse" | mlr3spatial |
"clust" | "clust.dunn" | mlr3cluster |
# Hyperparameter optimization on the Palmer Penguins data set
task = tsk("penguins")
# Load learner and set search space
learner = lrn("classif.rpart",
cp = to_tune(1e-04, 1e-1, logscale = TRUE)
)
# Construct tuning instance
instance = ti(
task = task,
learner = learner,
resampling = rsmp("cv", folds = 3),
measures = msr("classif.ce"),
terminator = trm("evals", n_evals = 4)
)
# Choose optimization algorithm
tuner = tnr("random_search", batch_size = 2)
# Run tuning
tuner$optimize(instance)
# Set optimal hyperparameter configuration to learner
learner$param_set$values = instance$result_learner_param_vals
# Train the learner on the full data set
learner$train(task)
# Inspect all evaluated configurations
as.data.table(instance$archive)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.