mlr_tuners_irace: Tuning via Iterated Racing.

Description Dictionary Parameters Archive Result Progress Bars Logging Super classes Methods Source See Also Examples

Description

TunerIrace class that implements iterated racing. Calls irace::irace() from package irace.

Dictionary

This Tuner can be instantiated via the dictionary mlr_tuners or with the associated sugar function tnr():

1
2
3
TunerIrace$new()
mlr_tuners$get("irace")
tnr("irace")

Parameters

n_instances

integer(1)
Number of resampling instances.

For the meaning of all other parameters, see irace::defaultScenario(). Note that we have removed all control parameters which refer to the termination of the algorithm. Use TerminatorEvals instead. Other terminators do not work with TunerIrace.

Archive

The ArchiveTuning holds the following additional columns:

Result

The tuning result (instance$result) is the best performing elite of the final race. The reported performance is the average performance estimated on all used instances.

Progress Bars

$optimize() supports progress bars via the package progressr combined with a 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.

Super classes

mlr3tuning::Tuner -> mlr3tuning::TunerFromOptimizer -> TunerIrace

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
TunerIrace$new()

Method optimize()

Performs the tuning on a TuningInstanceSingleCrit until termination. The single evaluations and the final results will be written into the ArchiveTuning that resides in the TuningInstanceSingleCrit. The final result is returned.

Usage
TunerIrace$optimize(inst)
Arguments
inst

(TuningInstanceSingleCrit).

Returns

data.table::data.table.


Method clone()

The objects of this class are cloneable with this method.

Usage
TunerIrace$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Source

Lopez-Ibanez M, Dubois-Lacoste J, Caceres LP, Birattari M, Stuetzle T (2016). “The irace package: Iterated racing for automatic algorithm configuration.” Operations Research Perspectives, 3, 43–58. doi: 10.1016/j.orp.2016.09.002.

See Also

Other Tuner: mlr_tuners_cmaes, mlr_tuners_design_points, mlr_tuners_gensa, mlr_tuners_grid_search, mlr_tuners_nloptr, mlr_tuners_random_search

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# retrieve task
task = tsk("pima")

# load learner and set search space
learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE))

# hyperparameter tuning on the pima indians diabetes data set
instance = tune(
  method = "irace",
  task = task,
  learner = learner,
  resampling = rsmp("holdout"),
  measure = msr("classif.ce"),
  term_evals = 42
)

# best performing hyperparameter configuration
instance$result

# all evaluated hyperparameter configuration
as.data.table(instance$archive)

# fit final model on complete data set
learner$param_set$values = instance$result_learner_param_vals
learner$train(task)

mlr3tuning documentation built on Sept. 14, 2021, 9:08 a.m.