Surrogate: Surrogate Model

SurrogateR Documentation

Surrogate Model

Description

Abstract surrogate model class.

A surrogate model is used to model the unknown objective function(s) based on all points evaluated so far.

Active bindings

learner

(learner)
Arbitrary learner object depending on the subclass. Subclasses validate the learner on assignment.

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 ids of variables that should be used as features. By default, automatically inferred based on the archive.

cols_y

(character() | NULL)
Column ids of variables that should be used as targets. By default, automatically inferred based on the archive.

param_set

(paradox::ParamSet)
Set of hyperparameters.

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".

output_trafo

(OutputTrafo | NULL)
Output transformation. Defaults to NULL for subclasses that do not support output transformations.

output_trafo_must_be_considered

(logical(1))
Whether a transformation has been applied to the target variable that has not been inverted during prediction.

Methods

Public methods


Surrogate$new()

Creates a new instance of this R6 class.

Usage
Surrogate$new(learner, archive, cols_x, cols_y, param_set)
Arguments
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.


Surrogate$update()

Train learner with new data. Subclasses must implement private.update() and private.update_async().

Usage
Surrogate$update()
Returns

NULL.


Surrogate$reset()

Reset the surrogate model. Subclasses must implement private$.reset().

Usage
Surrogate$reset()
Returns

NULL


Surrogate$predict()

Predict mean response and standard error. Must be implemented by subclasses.

Usage
Surrogate$predict(xdt)
Arguments
xdt

(data.table::data.table())
New data. One row per observation.

Returns

Arbitrary prediction object.


Surrogate$format()

Helper for print outputs.

Usage
Surrogate$format()
Returns

(character(1)).


Surrogate$print()

Print method.

Usage
Surrogate$print()
Returns

(character()).


Surrogate$clone()

The objects of this class are cloneable with this method.

Usage
Surrogate$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


mlr3mbo documentation built on July 21, 2026, 5:08 p.m.