SLEnsemble_cfg
is a configuration class for estimation of a model
using an ensemble of models using SuperLearner
.
tidyhte::Model_cfg
-> SLEnsemble_cfg
cvControl
A list of parameters for controlling the cross-validation used in SuperLearner.
SL.library
A vector of the names of learners to include in the SuperLearner ensemble.
SL.env
An environment containing all of the programmatically generated learners to be included in the SuperLearner ensemble.
family
stats::family
object to determine how SuperLearner
should be fitted.
model_class
The class of the model, required for all classes
which inherit from Model_cfg
.
new()
Create a new SLEnsemble_cfg
object with specified settings.
SLEnsemble_cfg$new(
cvControl = NULL,
learner_cfgs = NULL,
family = stats::gaussian()
)
cvControl
A list of parameters for controlling the
cross-validation used in SuperLearner.
For more details, see SuperLearner::SuperLearner.CV.control
.
learner_cfgs
A list of SLLearner_cfg
objects.
family
stats::family
object to determine how SuperLearner should be fitted.
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)
add_sublearner()
Adds a model (or class of models) to the SuperLearner ensemble. If hyperparameter values are specified, this method will add a learner for every element in the cross-product of provided hyperparameter values.
learner_name
Possible values
use SuperLearner
naming conventions. A full list is available
with SuperLearner::listWrappers("SL")
hps
A named list of hyper-parameters. Every element of the cross-product of these hyper-parameters will be included in the ensemble. cfg <- SLEnsemble_cfg$new( learner_cfgs = list(SLLearner_cfg$new("SL.glm")) ) cfg <- cfg$add_sublearner("SL.gam", list(deg.gam = c(2, 3)))
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)
#> <SLEnsemble_cfg>
#> Inherits from: <Model_cfg>
#> Public:
#> SL.env: environment
#> SL.library: SL.glm SL.gam
#> add_sublearner: function (learner_name, hps = NULL)
#> clone: function (deep = FALSE)
#> cvControl: list
#> family: family
#> initialize: function (cvControl = NULL, learner_cfgs = NULL, family = stats::gaussian())
#> model_class: SL
## ------------------------------------------------
## Method `SLEnsemble_cfg$new`
## ------------------------------------------------
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)
#> <SLEnsemble_cfg>
#> Inherits from: <Model_cfg>
#> Public:
#> SL.env: environment
#> SL.library: SL.glm SL.gam
#> add_sublearner: function (learner_name, hps = NULL)
#> clone: function (deep = FALSE)
#> cvControl: list
#> family: family
#> initialize: function (cvControl = NULL, learner_cfgs = NULL, family = stats::gaussian())
#> model_class: SL