Create control structures for multi-criteria tuning.
Source:R/TuneMultiCritControl.R
, R/TuneMultiCritControlGrid.R
, R/TuneMultiCritControlMBO.R
, and 2 more
TuneMultiCritControl.Rd
The following tuners are available:
- makeTuneMultiCritControlGrid
Grid search. All kinds of parameter types can be handled. You can either use their correct param type and
resolution
, or discretize them yourself by always using ParamHelpers::makeDiscreteParam in thepar.set
passed to tuneParams.- makeTuneMultiCritControlRandom
Random search. All kinds of parameter types can be handled.
- makeTuneMultiCritControlNSGA2
Evolutionary method mco::nsga2. Can handle numeric(vector) and integer(vector) hyperparameters, but no dependencies. For integers the internally proposed numeric values are automatically rounded.
- makeTuneMultiCritControlMBO
Model-based/ Bayesian optimization. All kinds of parameter types can be handled.
Usage
makeTuneMultiCritControlGrid(
same.resampling.instance = TRUE,
resolution = 10L,
log.fun = "default",
final.dw.perc = NULL,
budget = NULL
)
makeTuneMultiCritControlMBO(
n.objectives = mbo.control$n.objectives,
same.resampling.instance = TRUE,
impute.val = NULL,
learner = NULL,
mbo.control = NULL,
tune.threshold = FALSE,
tune.threshold.args = list(),
continue = FALSE,
log.fun = "default",
final.dw.perc = NULL,
budget = NULL,
mbo.design = NULL
)
makeTuneMultiCritControlNSGA2(
same.resampling.instance = TRUE,
impute.val = NULL,
log.fun = "default",
final.dw.perc = NULL,
budget = NULL,
...
)
makeTuneMultiCritControlRandom(
same.resampling.instance = TRUE,
maxit = 100L,
log.fun = "default",
final.dw.perc = NULL,
budget = NULL
)
Arguments
- same.resampling.instance
(
logical(1)
)
Should the same resampling instance be used for all evaluations to reduce variance? Default isTRUE
.- resolution
(integer)
Resolution of the grid for each numeric/integer parameter inpar.set
. For vector parameters, it is the resolution per dimension. Either pass one resolution for all parameters, or a named vector. See ParamHelpers::generateGridDesign. Default is 10.- log.fun
(
function
|character(1)
)
Function used for logging. If set to “default” (the default), the evaluated design points, the resulting performances, and the runtime will be reported. If set to “memory” the memory usage for each evaluation will also be displayed, withcharacter(1)
small increase in run time. Otherwisecharacter(1)
function with argumentslearner
,resampling
,measures
,par.set
,control
,opt.path
,dob
,x
,y
,remove.nas
,stage
andprev.stage
is expected. The default displays the performance measures, the time needed for evaluating, the currently used memory and the max memory ever used before (the latter two both taken from gc). See the implementation for details.- final.dw.perc
(
boolean
)
If a Learner wrapped by a makeDownsampleWrapper is used, you can define the value ofdw.perc
which is used to train the Learner with the final parameter setting found by the tuning. Default isNULL
which will not change anything.- budget
(
integer(1)
)
Maximum budget for tuning. This value restricts the number of function evaluations. In case ofmakeTuneMultiCritControlGrid
this number must be identical to the size of the grid. FormakeTuneMultiCritControlRandom
thebudget
equals the number of iterations (maxit
) performed by the random search algorithm. In case ofmakeTuneMultiCritControlNSGA2
thebudget
corresponds to the product of the maximum number of generations (max(generations)
) + 1 (for the initial population) and the size of the population (popsize
). FormakeTuneMultiCritControlMBO
thebudget
equals the number of objective function evaluations, i.e. the number of MBO iterations + the size of the initial design. If notNULL
, this will overwrite existing stopping conditions inmbo.control
.- n.objectives
(
integer(1)
)
Number of objectives, i.e. number of Measures to optimize.- impute.val
(numeric)
If something goes wrong during optimization (e.g. the learner crashes), this value is fed back to the tuner, so the tuning algorithm does not abort. Imputation is only active ifon.learner.error
is configured not to stop in configureMlr. It is not stored in the optimization path, an NA and a corresponding error message are logged instead. Note that this value is later multiplied by -1 for maximization measures internally, so you need to enter a larger positive value for maximization here as well. Default is the worst obtainable value of the performance measure you optimize for when you aggregate by mean value, orInf
instead. For multi-criteria optimization pass a vector of imputation values, one for each of your measures, in the same order as your measures.- learner
(Learner |
NULL
)
The surrogate learner: A regression learner to model performance landscape. For the default,NULL
, mlrMBO will automatically create a suitable learner based on the rules described in mlrMBO::makeMBOLearner.- mbo.control
(mlrMBO::MBOControl |
NULL
)
Control object for model-based optimization tuning. For the default,NULL
, the control object will be created with all the defaults as described in mlrMBO::makeMBOControl.- tune.threshold
(
logical(1)
)
Should the threshold be tuned for the measure at hand, after each hyperparameter evaluation, via tuneThreshold? Only works for classification if the predict type is “prob”. Default isFALSE
.- tune.threshold.args
(list)
Further arguments for threshold tuning that are passed down to tuneThreshold. Default is none.- continue
(
logical(1)
)
Resume calculation from previous run using mlrMBO::mboContinue? Requires “save.file.path” to be set. Note that the ParamHelpers::OptPath in the mlrMBO::OptResult will only include the evaluations after the continuation. The complete OptPath will be found in the slot$mbo.result$opt.path
.- mbo.design
(data.frame |
NULL
)
Initial design as data frame. If the parameters have corresponding trafo functions, the design must not be transformed before it is passed! For the default,NULL
, a default design is created like described in mlrMBO::mbo.- ...
(any)
Further control parameters passed to thecontrol
arguments of cmaes::cma_es or GenSA::GenSA, as well as towards thetunerConfig
argument of irace::irace.- maxit
(
integer(1)
)
Number of iterations for random search. Default is 100.
Value
(TuneMultiCritControl). The specific subclass is one of TuneMultiCritControlGrid, TuneMultiCritControlRandom, TuneMultiCritControlNSGA2, TuneMultiCritControlMBO.
See also
Other tune_multicrit:
plotTuneMultiCritResult()
,
tuneParamsMultiCrit()