This function is analog to `mlrMBO::mbo` and can be parallelized.

randomsearch(fun, design = NULL, max.evals = 20, max.execbudget = NULL, = NULL, design.y.cols = NULL,
  par.dir = "~/.randomsearch/", = NULL)



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.


Initial design as data frame. If the y-values are not already present in design, randomsearch 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 no initial design.


Maximum number of evaulations of the objective functions. Includes the initial design.


Exceution time budget in seconds.

Traget function value.


The name of the column containing the function outcomes. One for single-crit optimization. Multiple for multi-crit optimization.


Location to store parallel communication files.

How many parallel jobs do jo want to run to evaluate the random search?




# simple 2d objective function = makeSingleObjectiveFunction( fn = function(x) x[1]^2 + sin(x[2]), par.set = makeNumericParamSet(id = "x", lower = -1, upper = 1, len = 2) ) # start random search res = randomsearch(, max.evals = 10)