
Extract Inner Tuning Archives
Source:R/extract_inner_tuning_archives.R
extract_inner_tuning_archives.RdExtract inner tuning archives of nested resampling.
Implemented for mlr3::ResampleResult and mlr3::BenchmarkResult.
The function iterates over the AutoTuner objects and binds the tuning archives to a data.table::data.table().
AutoTuner must be initialized with store_tuning_instance = TRUE and mlr3::resample() or mlr3::benchmark()
must be called with store_models = TRUE.
Arguments
- x
- unnest
(
character())
Transforms list columns to separate columns. By default,x_domainis unnested. Set toNULLif no column should be unnested.- exclude_columns
(
character())
Exclude columns from result table. Set toNULLif no column should be excluded.
Data structure
The returned data table has the following columns:
experiment(integer(1))
Index, giving the according row number in the original benchmark grid.iteration(integer(1))
Iteration of the outer resampling.One column for each hyperparameter of the search spaces.
One column for each performance measure.
runtime_learners(numeric(1))
Sum of training and predict times logged in learners per mlr3::ResampleResult / evaluation. This does not include potential overhead time.timestamp(POSIXct)
Time stamp when the evaluation was logged into the archive.batch_nr(integer(1))
Hyperparameters are evaluated in batches. Each batch has a unique batch number.x_domain(list())
List of transformed hyperparameter values. By default this column is unnested.x_domain_*(any)
Separate column for each transformed hyperparameter.resample_result(mlr3::ResampleResult)
Resample result of the inner resampling.task_id(character(1)).learner_id(character(1)).resampling_id(character(1)).
Examples
# Nested Resampling on Palmer Penguins Data Set
learner = lrn("classif.rpart",
cp = to_tune(1e-04, 1e-1, logscale = TRUE))
# create auto tuner
at = auto_tuner(
tuner = tnr("random_search"),
learner = learner,
resampling = rsmp ("holdout"),
measure = msr("classif.ce"),
term_evals = 4)
resampling_outer = rsmp("cv", folds = 2)
rr = resample(tsk("iris"), at, resampling_outer, store_models = TRUE)
# extract inner archives
extract_inner_tuning_archives(rr)
#> iteration cp classif.ce x_domain_cp runtime_learners
#> <int> <num> <num> <num> <num>
#> 1: 1 -6.080660 0.00 0.0022866675 0.006
#> 2: 1 -3.074362 0.00 0.0462191016 0.007
#> 3: 1 -6.146306 0.00 0.0021413785 0.007
#> 4: 1 -7.163631 0.00 0.0007742379 0.007
#> 5: 2 -6.789427 0.12 0.0011256134 0.007
#> 6: 2 -3.335414 0.12 0.0355998298 0.006
#> 7: 2 -9.074120 0.12 0.0001145934 0.007
#> 8: 2 -4.958683 0.12 0.0070221733 0.007
#> timestamp warnings errors batch_nr resample_result task_id
#> <POSc> <int> <int> <int> <list> <char>
#> 1: 2026-07-26 08:45:29 0 0 1 <ResampleResult> iris
#> 2: 2026-07-26 08:45:29 0 0 2 <ResampleResult> iris
#> 3: 2026-07-26 08:45:29 0 0 3 <ResampleResult> iris
#> 4: 2026-07-26 08:45:29 0 0 4 <ResampleResult> iris
#> 5: 2026-07-26 08:45:29 0 0 1 <ResampleResult> iris
#> 6: 2026-07-26 08:45:29 0 0 2 <ResampleResult> iris
#> 7: 2026-07-26 08:45:29 0 0 3 <ResampleResult> iris
#> 8: 2026-07-26 08:45:30 0 0 4 <ResampleResult> iris
#> learner_id resampling_id
#> <char> <char>
#> 1: classif.rpart.tuned cv
#> 2: classif.rpart.tuned cv
#> 3: classif.rpart.tuned cv
#> 4: classif.rpart.tuned cv
#> 5: classif.rpart.tuned cv
#> 6: classif.rpart.tuned cv
#> 7: classif.rpart.tuned cv
#> 8: classif.rpart.tuned cv