mlr_terminators_budget | R Documentation |
Terminator
that terminates after the sum (or similar aggregate) of a given "budget" search space component croses a threshold.
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")
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 the budget
configuration parameter. If this function returns a value greater or equal to budget
the termination
criterion is matched. Calling this function with NULL
must return the lower bound of the budget value; percentage
progress is reported as the progress from this lower bound to the value of budget
. Initialized to sum()
.
bbotk::Terminator
-> TerminatorBudget
new()
Initialize the TerminatorBudget
object.
TerminatorBudget$new()
is_terminated()
Is TRUE
if when the termination criterion is matched, FALSE
otherwise.
TerminatorBudget$is_terminated(archive)
archive
Archive
Archive to check.
logical(1)
: Whether to terminate.
clone()
The objects of this class are cloneable with this method.
TerminatorBudget$clone(deep = FALSE)
deep
Whether to make a deep clone.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.