Toolbox for Bayesian Optimization and Model-Based Optimization in R
library(knitr)
library(gifski)
opts_knit$set(upload.fun = imgur_upload, base.url = NULL) # upload all images to imgur.com
opts_chunk$set(fig.width=5, fig.height=5, cache=TRUE)
Package website: mlrmbo.mlr-org.com
Model-based optimization with mlr.
We recommend to install the official release version:
install.packages("mlrMBO")
For experimental use you can install the latest development version:
remotes::install_github("mlr-org/mlrMBO")
set.seed(2)
library(ggplot2)
library(mlrMBO)
library(animation)
configureMlr(show.learner.output = FALSE)
pause = interactive()
set.seed(1)
fn = makeCosineMixtureFunction(1)
obj.fun = convertToMinimization(fn)
# mbo control with defaults
ctrl = makeMBOControl()
ctrl = setMBOControlTermination(ctrl, iters = 10L)
ctrl = setMBOControlInfill(ctrl, crit = makeMBOInfillCritEI(), opt = "focussearch", opt.focussearch.points = 500L, opt.restarts = 1L)
design = generateDesign(5L, getParamSet(obj.fun), fun = lhs::maximinLHS)
run = exampleRun(obj.fun, design = design,
control = ctrl, points.per.dim = 1000, show.info = TRUE)
for(i in 1:10) {
plotExampleRun(run, iters = i, pause = pause, densregion = TRUE, gg.objects = list(theme_bw()))
}
mlrMBO
is a highly configurable R toolbox for model-based / Bayesian optimization of black-box functions.
Features:
For the surrogate, mlrMBO
allows any regression learner from mlr
, including:
DiceKriging
)randomForest
)Various infill criteria (aka. acquisition functions) are available:
Objective functions are created with package smoof, which also offers many test functions for example runs or benchmarks.
Parameter spaces and initial designs are created with package ParamHelpers.
Please cite our arxiv paper (Preprint).
You can get citation info via citation("mlrMBO")
or copy the following BibTex entry:
@article{mlrMBO,
title = {{{mlrMBO}}: {{A Modular Framework}} for {{Model}}-{{Based Optimization}} of {{Expensive Black}}-{{Box Functions}}},
url = {https://arxiv.org/abs/1703.03373},
shorttitle = {{{mlrMBO}}},
archivePrefix = {arXiv},
eprinttype = {arxiv},
eprint = {1703.03373},
primaryClass = {stat},
author = {Bischl, Bernd and Richter, Jakob and Bossek, Jakob and Horn, Daniel and Thomas, Janek and Lang, Michel},
date = {2017-03-09},
}
Some parts of the package were created as part of other publications.
If you use these parts, please cite the relevant work appropriately: