Skip to contents

This function allows to construct a SurrogateLearner in the spirit of mlr_sugar from mlr3.

Usage

srlrn(learner, archive = NULL, x_cols = NULL, y_col = NULL, ...)

Arguments

learner

(mlr3::LearnerRegr)
mlr3::LearnerRegr that is to be used.

archive

(NULL | bbotk::Archive)
bbotk::Archive of the bbotk::OptimInstance used. Can also be NULL.

x_cols

(NULL | character())
Names of columns in the bbotk::Archive that should be used as features. Can also be NULL.

y_col

(NULL | character(1))
Name of the column in the bbotk::Archive that should be used as a target. Can also be NULL.

...

(named list())
Named arguments passed to the constructor, to be set as parameters in the paradox::ParamSet.

Examples

srlrn(lrn("regr.featureless"), catch_errors = FALSE)
#> <SurrogateLearner>: LearnerRegrFeatureless
#> * Parameters: assert_insample_perf=FALSE, catch_errors=FALSE