Description Usage Arguments Value Examples
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.
1 | focussearch(fn, par.set, control, show.info = FALSE, ...)
|
fn |
[ |
par.set |
[ |
control |
[ |
show.info |
('logical(1)') |
... |
[any] |
[ParamSet
]
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.