focussearch: Run focus search.

Description Usage Arguments Value Examples

Description

Perform random search on a region, that is sequentially shrinked around the best performing parameters. Parameters in ('FocusSearchControl') allows for controlling the number of sampled points, restarts and the number of shrinking iterations.

_points_ randomly sampled points from the parameter set are used in each iteration. Numeric values are shrinked to an interval around the best obtained value of half of the previous length in each iteration, while for discrete variables, a random, not best-performing level is dropped. In order to improve method robustness, several restarts can be made.

Usage

1
focussearch(fn, par.set, control, show.info = FALSE, ...)

Arguments

fn

[smoof_single_objective_function]
Objective function.

par.set

[ParamSet]
Param set.

control

[FocusSearchControl]
Control object.

show.info

('logical(1)')
Should the parameter sets be printed while training? Defaults is 'FALSE'.

...

[any]
Passed to fn.

Value

[ParamSet]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Fully numeric space
f = smoof::makeSphereFunction(2)
fn = function(x) apply(x, 1, f)
ctrl = makeFocusSearchControl(maxit = 3, restarts = 5, points = 100)
ps = makeParamSet(
  makeNumericParam("x1", lower = 0, upper = 10),
  makeNumericParam("x2", lower = 0, upper = 10)
  )
focussearch(fn, ps, ctrl)
# Mixed space  
f2 = smoof::makeSwiler2014Function()
fn2 = function(x) {sapply(BBmisc::convertRowsToList(x, name.vector = TRUE), f2)}
ctrl = makeFocusSearchControl(maxit = 3, restarts = 5, points = 100)
ps = makeParamSet(
  makeDiscreteParam("x1", values = as.character(1:5)),
  makeNumericParam("x2", lower = 0, upper = 1),
  makeNumericParam("x3", lower = 0, upper = 1)
)
focussearch(fn2, ps, ctrl)

berndbischl/focussearch documentation built on May 12, 2019, 4:28 p.m.