mlr_terminators_budget {miesmuschel} | R Documentation |
Terminator that Limits Total Budget Component Evaluation
Description
Terminator
that terminates after the sum (or similar aggregate) of a given "budget" search space component croses a threshold.
Dictionary
This Terminator
can be created with the short access form trm()
(trms()
to get a list),
or through the dictionary mlr_terminators
in the following way:
# preferred trm("budget") trms("budget") # takes vector IDs, returns list of Terminators # long form mlr_terminators$get("budget")
Configuration Parameters
-
budget
::numeric(1)
Total budget available, after which to stop. Not initialized and should be set to the desired value during construction. -
aggregate
::function
Function taking a vector of values of the budget search space component, returning a scalar value to be compared to thebudget
configuration parameter. If this function returns a value greater or equal tobudget
the termination criterion is matched. Calling this function withNULL
must return the lower bound of the budget value; percentage progress is reported as the progress from this lower bound to the value ofbudget
. Initialized tosum()
.
Super class
bbotk::Terminator
-> TerminatorBudget
Methods
Public methods
Inherited methods
Method new()
Initialize the TerminatorBudget
object.
Usage
TerminatorBudget$new()
Method is_terminated()
Is TRUE
if when the termination criterion is matched, FALSE
otherwise.
Usage
TerminatorBudget$is_terminated(archive)
Arguments
archive
Archive
Archive to check.
Returns
logical(1)
: Whether to terminate.
Method clone()
The objects of this class are cloneable with this method.
Usage
TerminatorBudget$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
library("bbotk")
# Evaluate until sum of budget component of evaluated configs is >= 100
trm("budget", budget = 100)
# Evaluate until sum of two to the power of budget component is >= 100
trm("budget", budget = 1024, aggregate = function(x) sum(2 ^ x))