Description Usage Arguments Examples
Smac minimization function
1 | rsmac_minimize(grid, objective, pysmac_args = NULL, init_rcode = NULL)
|
grid |
list like list(x1=list(type='continuous', init=0, min=-5, max=10), x2=..) |
objective |
objective function to minimize |
pysmac_args |
list of pysmac additional parameters. The description is here: https://github.com/automl/pysmac/blob/a3452d56aa1f3352c36ec0750be75a1f8fafe509/pysmac/optimize.py#L32-L38 |
init_rcode |
r code expression that will be runned once before pysmac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
objective <- function(x1, x2) {
(x2 - (5.1 / (4*pi^2))*x1^2 + (5 / pi)*x1 - 6)^2 +
10*(1-(1 / (8*pi))) * cos(x1) + 10
}
grid <- list(
x1=list(type='continuous', init=0, min=-5, max=10),
x2=list(type='continuous', init=0, min=0, max=15))
res <- rsmac_minimize(grid, objective, list(max_evaluations=100))
stopifnot(abs(res$target_min - 0.6) < 0.1)
stopifnot(abs(res$optimized_x$x1 - 2.937) < 0.1)
stopifnot(abs(res$optimized_x$x2 - 2.365) < 0.1)
cat('\n')
print(res)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.