Abstract surrogate model class.
A surrogate model is used to model the unknown objective function(s) based on all points evaluated so far.
learner
(learner)
Arbitrary learner object depending on the subclass.
print_id
(character
)
Id used when printing.
archive
(bbotk::Archive | NULL
)
bbotk::Archive of the bbotk::OptimInstance.
archive_is_async
(`bool(1)``)
Whether the bbotk::Archive is an asynchronous one.
n_learner
(integer(1)
)
Returns the number of surrogate models.
cols_x
(character()
| NULL
)
Column id's of variables that should be used as features.
By default, automatically inferred based on the archive.
cols_y
(character()
| NULL
)
Column id's of variables that should be used as targets.
By default, automatically inferred based on the archive.
insample_perf
(numeric()
)
Surrogate model's current insample performance.
param_set
(paradox::ParamSet)
Set of hyperparameters.
assert_insample_perf
(numeric()
)
Asserts whether the current insample performance meets the performance threshold.
packages
(character()
)
Set of required packages.
A warning is signaled if at least one of the packages is not installed, but loaded (not attached) later on-demand via requireNamespace()
.
feature_types
(character()
)
Stores the feature types the surrogate can handle, e.g. "logical"
, "numeric"
, or "factor"
.
A complete list of candidate feature types, grouped by task type, is stored in mlr_reflections$task_feature_types
.
properties
(character()
)
Stores a set of properties/capabilities the surrogate has.
A complete list of candidate properties, grouped by task type, is stored in mlr_reflections$learner_properties
.
predict_type
(character(1)
)
Retrieves the currently active predict type, e.g. "response"
.
new()
Creates a new instance of this R6 class.
Surrogate$new(learner, archive, cols_x, cols_y, param_set)
learner
(learner)
Arbitrary learner object depending on the subclass.
archive
(bbotk::Archive | NULL
)
bbotk::Archive of the bbotk::OptimInstance.
cols_x
(character()
| NULL
)
Column id's of variables that should be used as features.
By default, automatically inferred based on the archive.
cols_y
(character()
| NULL
)
Column id's of variables that should be used as targets.
By default, automatically inferred based on the archive.
param_set
(paradox::ParamSet)
Parameter space description depending on the subclass.
update()
Train learner with new data.
Subclasses must implement private.update()
and private.update_async()
.
Surrogate$update()
NULL
.
reset()
Reset the surrogate model.
Subclasses must implement private$.reset()
.
Surrogate$reset()
NULL
predict()
Predict mean response and standard error. Must be implemented by subclasses.
Surrogate$predict(xdt)
xdt
(data.table::data.table()
)
New data. One row per observation.
Arbitrary prediction object.
(character(1)
).
(character()
).
clone()
The objects of this class are cloneable with this method.
Surrogate$clone(deep = FALSE)
deep
Whether to make a deep clone.