bbotk v0.2.2

0

Monthly downloads

0th

Percentile

Black-Box Optimization Toolkit

Provides a common framework for optimization of black-box functions for other packages, e.g. 'mlr3'. It offers various optimization methods e.g. grid search, random search and generalized simulated annealing.

Readme

bbotk - Black-Box Optimization Toolkit

Package website: release

tic CRAN Status Badge codecov.io

This package provides a common framework for optimization including

  • Optimizer: Objects of this class allow you to optimize an object of the class OptimInstance.
  • OptimInstance: Defines the optimization problem, consisting of an Objective, the search_space and a Terminator. All evaluations on the OptimInstance will be automatically stored in its own Archive.
  • Objective: Objects of this class contain the objective function. The class ensures that the objective function is called in the right way and defines, whether the function should be minimized or maximized.
  • Terminator: Objects of this class control the termination of the optimization independent of the optimizer.

Various optimization methods are already implemented e.g. grid search, random search and generalized simulated annealing.

Installation

CRAN version

install.packages("bbotk")

Development version

remotes::install_github("mlr-org/bbotk")

Example

library(bbotk)
library(paradox)

# Define objective function
fun = function(xs) {
  - (xs[[1]] - 2)^2 - (xs[[2]] + 3)^2 + 10
}

# Set domain
domain = ParamSet$new(list(
  ParamDbl$new("x1", -10, 10), 
  ParamDbl$new("x2", -5, 5)
))

# Set codomain
codomain = ParamSet$new(list(
  ParamDbl$new("y", tags = "maximize")
))

# Create Objective object
obfun = ObjectiveRFun$new(
  fun = fun,
  domain = domain,
  codomain = codomain, 
  properties = "deterministic"
)

# Define termination criterion
terminator = trm("evals", n_evals = 20)

# Create optimization instance
instance = OptimInstanceSingleCrit$new(
  objective = obfun, 
  terminator = terminator
)

# Load optimizer
optimizer = opt("gensa")

# Trigger optimization
optimizer$optimize(instance)

# View results
instance$result

Functions in bbotk

Name Description
Terminator Abstract Terminator Class
Objective Objective function with domain and co-domain
Optimizer Optimizer
Archive Logging object for objective function evaluations
OptimizerNLoptr Optimization via Non-linear Optimization
OptimInstanceMultiCrit Optimization Instance with budget and archive
OptimInstanceSingleCrit Optimization Instance with budget and archive
OptimInstance Optimization Instance with budget and archive
ObjectiveRFun Objective interface with custom R function
ObjectiveRFunDt Objective interface for basic R functions.
bbotk_assertions Assertion for bbotk objects
mlr_optimizers_gensa Optimization via Generalized Simulated Annealing
mlr_optimizers_grid_search Optimization via Grid Search
mlr_optimizers_cmaes Optimization via Covariance Matrix Adaptation Evolution Strategy
mlr_optimizers_design_points Optimization via Design Points
mlr_terminators_perf_reached Terminator that stops when a performance level has been reached
mlr_terminators_run_time Terminator that stops according to the run time
bbotk_reflections Reflections for bbotk
mlr_optimizers_random_search Optimization via Random Search
bbotk-package bbotk: Black-Box Optimization Toolkit
trm Syntactic Sugar Terminator Construction
optimize_default Default optimization function
transform_xdt_to_xss Calculates the transformed x-values
assign_result_default Default assign_result function
mlr_terminators Dictionary of Terminators
mlr_terminators_clock_time Terminator that stops according to the clock time
mlr_terminators_combo Combine Terminators
mlr_optimizers Dictionary of Optimizer
is_dominated Calculate which points are dominated
mlr_terminators_none Terminator that never stops.
opt Syntactic Sugar Optimizer Construction
mult_max_to_min Multiplication vector for output
mlr_terminators_evals Terminator that stops after a number of evaluations
mlr_terminators_stagnation Terminator that stops when optimization does not improve
mlr_terminators_stagnation_batch Terminator that stops when optimization does not improve
No Results!

Vignettes of bbotk

Name
bbotk.Rmd
No Results!

Last month downloads

Details

License LGPL-3
URL https://bbotk.mlr-org.com, https://github.com/mlr-org/bbotk
BugReports https://github.com/mlr-org/bbotk/issues
VignetteBuilder knitr
Encoding UTF-8
Language en-US
NeedsCompilation yes
RoxygenNote 7.1.1
Collate 'Archive.R' 'Objective.R' 'ObjectiveRFun.R' 'ObjectiveRFunDt.R' 'OptimInstance.R' 'OptimInstanceMultiCrit.R' 'OptimInstanceSingleCrit.R' 'mlr_optimizers.R' 'Optimizer.R' 'OptimizerCmaes.R' 'OptimizerDesignPoints.R' 'OptimizerGenSA.R' 'OptimizerGridSearch.R' 'OptimizerNLoptr.R' 'OptimizerRandomSearch.R' 'mlr_terminators.R' 'Terminator.R' 'TerminatorClockTime.R' 'TerminatorCombo.R' 'TerminatorEvals.R' 'TerminatorNone.R' 'TerminatorPerfReached.R' 'TerminatorRunTime.R' 'TerminatorStagnation.R' 'TerminatorStagnationBatch.R' 'assertions.R' 'bbotk_reflections.R' 'bibentries.R' 'helper.R' 'sugar.R' 'zzz.R'
Packaged 2020-10-07 09:24:57 UTC; marc
Repository CRAN
Date/Publication 2020-10-08 11:00:03 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/bbotk)](http://www.rdocumentation.org/packages/bbotk)