OptimizerInterMBO {mlrintermbo}R Documentation

Tuner and Optimizer using mlrMBO

Description

mlrMBO tuning object.

mlrMBO must not be loaded directly into R when using mlr3, for various reasons. TunerInterMBO and OptimizerInterMBO take care that this does not happen.

Format

R6::R6Class object inheriting from Tuner (mlr3tuning package) or Optimizer (bbotk package).

Construction

To optimize an objective (using the bbotk package), use the OptimizerInterMBO object, ideally obtained through the bbotk::opt() function: opt("intermbo").

To tune a machine learning method represented by a mlr3::Learner object, use the TunerInterMBO obtained ideally through mlr3tuning::tnr(): tnr("intermbo").

Both have following optional arguments:

Configuration Parameters

The ParamSet of the optimizer / tuner reflects the possible configuration options of mlrMBO. The control parameters map directly to the arguments of mlrMBO::makeMBOControl(), mlrMBO::setMBOControlInfill(), mlrMBO::setMBOControlMultiObj(), mlrMBO::setMBOControlMultiPoint(), and mlrMBO::setMBOControlTermination().

Examples

library("paradox")
library("bbotk")

# silly example function: minimize x^2 for -1 < x < 1
domain <- ps(x = p_dbl(lower = -1, upper = 1))
codomain <- ps(y = p_dbl(tags = "minimize"))
objective <- ObjectiveRFun$new(function(xs) list(y = xs$x^2), domain, codomain)

# initialize instance
instance <- OptimInstanceSingleCrit$new(objective, domain, trm("evals", n_evals = 6))

# use intermbo optimizer
#
# Also warn on surrogate model errors
# (this is the default and can be omitted)
optser <- opt("intermbo", on.surrogate.error = "warn")

# optimizer has hyperparameters from mlrMBO
optser$param_set$values$final.method <- "best.predicted"

# optimization happens here.
optser$optimize(instance)

instance$result

[Package mlrintermbo version 0.5.1-1 Index]