See mbo_parallel for all parallelization options.

mbo(fun, design = NULL, learner = NULL, control,
  show.info = getOption("mlrMBO.show.info", TRUE), more.args = list())

Arguments

fun

[smoof_function]
Fitness function to optimize. For one dimensional target functions you can obtain a smoof_function by using makeSingleObjectiveFunction. For multi dimensional functions use makeMultiObjectiveFunction. It is possible to return even more information which will be stored in the optimization path. To achieve this, simply append the attribute “extras” to the return value of the target function. This has to be a named list of scalar values. Each of these values will be stored additionally in the optimization path.

design

[data.frame]
Initial design as data frame. If the y-values are not already present in design, mbo will evaluate the points. If the parameters have corresponding trafo functions, the design must not be transformed before it is passed! Functions to generate designs are available in ParamHelpers: generateDesign, generateGridDesign, generateRandomDesign. Default is NULL, which means generateDesign is called and a design of size 4 times number of all parameters is created The points are drawn via maximinLHS to maximize the minimal distance between design points.

learner

[Learner]
Regression learner from mlr, which is used as a surrogate to model our fitness function. If NULL (default), the default learner is determined as described here: mbo_default_learner.

control

[MBOControl]
Control object for mbo.

show.info

[logical(1)]
Verbose output on console? Default is TRUE.

more.args

[list]
Further arguments passed to fitness function.

Value

[MBOSingleObjResult | MBOMultiObjResult]

Examples

# simple 2d objective function obj.fun = makeSingleObjectiveFunction( fn = function(x) x[1]^2 + sin(x[2]), par.set = makeNumericParamSet(id = "x", lower = -1, upper = 1, len = 2) ) # create base control object ctrl = makeMBOControl() # do three MBO iterations ctrl = setMBOControlTermination(ctrl, iters = 3L) # use 500 points in the focussearch (should be sufficient for 2d) ctrl = setMBOControlInfill(ctrl, opt.focussearch.points = 500) # create initial design des = generateDesign(n = 5L, getParamSet(obj.fun), fun = lhs::maximinLHS) # start mbo res = mbo(obj.fun, design = des, control = ctrl) print(res)
#> Recommended parameters: #> x=-0.0306,-0.0169 #> Objective: y = -0.016 #> #> Optimization path #> 5 + 3 entries in total, displaying last 10 (or less): #> x1 x2 y dob eol error.message exec.time #> 1 -0.96769994 -0.26626679 0.67331156 0 NA <NA> 0 #> 2 0.44030435 0.66288338 0.80926007 0 NA <NA> 0 #> 3 -0.19704022 -0.01344260 0.02538265 0 NA <NA> 0 #> 4 -0.40088904 0.31590690 0.47139064 0 NA <NA> 0 #> 5 0.89315279 -0.69099140 0.16042044 0 NA <NA> 0 #> 6 -0.03064098 -0.01689882 -0.01595915 1 NA <NA> 0 #> 7 0.74929441 -0.04045232 0.52100082 2 NA <NA> 0 #> 8 -0.92334595 -0.01841571 0.83415307 3 NA <NA> 0 #> cb error.model train.time prop.type propose.time se #> 1 NA <NA> NA initdesign NA NA #> 2 NA <NA> NA initdesign NA NA #> 3 NA <NA> NA initdesign NA NA #> 4 NA <NA> NA initdesign NA NA #> 5 NA <NA> NA initdesign NA NA #> 6 -0.07233364 <NA> 0.152 infill_cb 0.180 0.1763127 #> 7 -0.17097244 <NA> 0.059 infill_cb 0.221 0.1632562 #> 8 -0.08533772 <NA> 0.071 infill_cb 0.167 0.1050546 #> mean lambda #> 1 NA NA #> 2 NA NA #> 3 NA NA #> 4 NA NA #> 5 NA NA #> 6 0.103979063 1 #> 7 -0.007716266 1 #> 8 0.019716910 1
# NOT RUN { plot(res) # }