| SLEnsemble_cfg {tidyhte} | R Documentation |
Configuration for a SuperLearner Ensemble
Description
SLEnsemble_cfg is a configuration class for estimation of a model
using an ensemble of models using SuperLearner.
Super class
tidyhte::Model_cfg -> SLEnsemble_cfg
Public fields
cvControlA list of parameters for controlling the cross-validation used in SuperLearner.
SL.libraryA vector of the names of learners to include in the SuperLearner ensemble.
SL.envAn environment containing all of the programmatically generated learners to be included in the SuperLearner ensemble.
familystats::familyobject to determine how SuperLearner should be fitted.model_classThe class of the model, required for all classes which inherit from
Model_cfg.
Methods
Public methods
Method new()
Create a new SLEnsemble_cfg object with specified settings.
Usage
SLEnsemble_cfg$new( cvControl = NULL, learner_cfgs = NULL, family = stats::gaussian() )
Arguments
cvControlA list of parameters for controlling the cross-validation used in SuperLearner. For more details, see
SuperLearner::SuperLearner.CV.control.learner_cfgsA list of
SLLearner_cfgobjects.familystats::familyobject to determine how SuperLearner should be fitted.
Returns
A new SLEnsemble_cfg object.
Examples
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)
Method 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.
Usage
SLEnsemble_cfg$add_sublearner(learner_name, hps = NULL)
Arguments
learner_namePossible values use
SuperLearnernaming conventions. A full list is available withSuperLearner::listWrappers("SL")hpsA 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)))
Method clone()
The objects of this class are cloneable with this method.
Usage
SLEnsemble_cfg$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)
## ------------------------------------------------
## Method `SLEnsemble_cfg$new`
## ------------------------------------------------
SLEnsemble_cfg$new(
learner_cfgs = list(SLLearner_cfg$new("SL.glm"), SLLearner_cfg$new("SL.gam"))
)