ArchiveBatch {bbotk} | R Documentation |
Data Table Storage
Description
The ArchiveBatch
stores all evaluated points and performance scores in a data.table::data.table()
.
S3 Methods
-
as.data.table(archive)
ArchiveBatch ->data.table::data.table()
Returns a tabular view of all performed function calls of the Objective. Thex_domain
column is unnested to separate columns.
Super class
bbotk::Archive
-> ArchiveBatch
Public fields
data
(data.table::data.table)
Contains all performed Objective function calls.data_extra
(named
list
)
Data created by specificOptimizer
s that does not relate to any individual function evaluation and can therefore not be held in$data
. Every optimizer should create and refer to its own entry in this list, named by itsclass()
.
Active bindings
n_evals
(
integer(1)
)
Number of evaluations stored in the archive.n_batch
(
integer(1)
)
Number of batches stored in the archive.
Methods
Public methods
Inherited methods
Method new()
Creates a new instance of this R6 class.
Usage
ArchiveBatch$new(search_space, codomain, check_values = FALSE)
Arguments
search_space
(paradox::ParamSet)
Specifies the search space for the Optimizer. The paradox::ParamSet describes either a subset of thedomain
of the Objective or it describes a set of parameters together with atrafo
function that transforms values from the search space to values of the domain. Depending on the context, this value defaults to the domain of the objective.codomain
(paradox::ParamSet)
Specifies codomain of function. Most importantly the tags of each output "Parameter" define whether it should be minimized or maximized. The default is to minimize each component.check_values
(
logical(1)
)
Should x-values that are added to the archive be checked for validity? Search space that is logged into archive.
Method add_evals()
Adds function evaluations to the archive table.
Usage
ArchiveBatch$add_evals(xdt, xss_trafoed = NULL, ydt)
Arguments
xdt
(
data.table::data.table()
)
Set of untransformed points / points from the search space. One point per row, e.g.data.table(x1 = c(1, 3), x2 = c(2, 4))
. Column names have to match ids of thesearch_space
. However,xdt
can contain additional columns.xss_trafoed
(
list()
)
Transformed point(s) in the domain space.ydt
(
data.table::data.table()
)
Optimal outcome.
Method best()
Returns the best scoring evaluation(s). For single-crit optimization, the solution that minimizes / maximizes the objective function. For multi-crit optimization, the Pareto set / front.
Usage
ArchiveBatch$best(batch = NULL, n_select = 1L, ties_method = "first")
Arguments
batch
(
integer()
)
The batch number(s) to limit the best results to. Default is all batches.n_select
(
integer(1L)
)
Amount of points to select. Ignored for multi-crit optimization.ties_method
(
character(1L)
)
Method to break ties when multiple points have the same score. Either"first"
(default) or"random"
. Ignored for multi-crit optimization. Ifn_select > 1L
, the tie method is ignored and the first point is returned.
Returns
Method nds_selection()
Calculate best points w.r.t. non dominated sorting with hypervolume contribution.
Usage
ArchiveBatch$nds_selection(batch = NULL, n_select = 1, ref_point = NULL)
Arguments
batch
(
integer()
)
The batch number(s) to limit the best points to. Default is all batches.n_select
(
integer(1L)
)
Amount of points to select.ref_point
(
numeric()
)
Reference point for hypervolume.
Returns
Method clear()
Clear all evaluation results from archive.
Usage
ArchiveBatch$clear()
Method clone()
The objects of this class are cloneable with this method.
Usage
ArchiveBatch$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.