Skip to contents

An bbotk::Objective subclass where evaluation uses a fitted regression learner to predict outcomes. This is useful for surrogate-based optimization where a model has been trained on observed data and we want to optimize over predicted outcomes.

Creates a new instance of this R6 class.

Evaluates multiple input values on the objective function.

Arguments

learner

(mlr3::LearnerRegr | named list of mlr3::LearnerRegr)
A fitted regression learner or a named list of fitted regression learners. Must have been trained via $train() before creating the objective. If this is a named list, its names must correspond to codomain target IDs. There must be one learner per codomain target. If this is a single learner, codomain must only have one parameter.

domain

(paradox::ParamSet)
Parameter set describing the input space. All parameter IDs must correspond to features the learner was trained on.

codomain

(paradox::ParamSet)
Parameter set describing the output space. Must contain at least one target tagged with "minimize", "maximize", or "learn".

id

(character(1))
Identifier for the objective.

check_values

(logical(1))
Whether to check validity of input configurations against the domain.

xdt

(data.table)
A data.table with one configuration per row.

Value

data.table::data.table() containing codomain columns.

Details

The learner must be trained before creating the objective. The domain parameters must correspond to features the learner was trained on. For factor features, domain levels must be a subset of the levels present in the training data (the learner cannot generalize to unseen factor levels).

Type compatibility:

  • ParamDbl corresponds to numeric training features

  • ParamInt corresponds to integer or numeric training features

  • ParamFct corresponds to factor training features (domain levels must be subset)

  • ParamLgl corresponds to logical training features

Fields

learner

(mlr3::LearnerRegr)
Read-only access to the internal learner. If there are multiple learners, this is the first one.

learners

(list of mlr3::LearnerRegr)
Read-only access to the internal learners. The names of the list are the codomain target IDs.