View source: R/115_MetaLearners.R
| setup_ConditionalSuperLearner | R Documentation |
Setup hyperparameters for the Conditional SuperLearner, which selects the best model from a library conditional on the covariates rather than combining them.
setup_ConditionalSuperLearner(
base_learners = list(setup_GLM(), setup_GLMNET(), setup_Ranger()),
meta_learner = setup_Ranger(),
inner_resampling_config = setup_KFold(n_resamples = 10L),
n_iterations = 4L,
loss = NULL,
init = "full",
min_region_size = 10L,
expand_search_spaces = TRUE,
ifw = FALSE
)
base_learners |
List of |
meta_learner |
|
inner_resampling_config |
|
n_iterations |
(Tunable) Integer [1, Inf): Alternations between fitting the oracle and refitting the experts. |
loss |
Optional Character {"squared_error", "log_loss"}: Per-case loss the oracle minimizes. |
init |
Character {"full", "random"}: Region each expert starts from. |
min_region_size |
Integer [1, Inf): Fewest cases an expert's region may hold before the expert keeps its previous fit instead of being refitted. |
expand_search_spaces |
Logical: If TRUE, expand a base learner's search space into one expert per combination. |
ifw |
(Tunable) Logical: If TRUE, use Inverse Frequency Weighting in classification. |
The model is sum_k 1\{o(x) = k\} F_k(x): an "oracle" o assigns each case to
one of the K "experts" F_k, and that expert predicts it. Oracle and experts
are fitted by alternating, in the manner of k-means: with the experts fixed,
the oracle minimizes the total loss, which reduces to a weighted K-class
classification over an extended dataset holding each case once per expert; with
the oracle fixed, each expert is refitted on the cases assigned to it. The
losses are cross-validated throughout, so an expert is never scored on a case
it was trained on.
The oracle is a classifier over the original covariates whatever the outcome is, so with more than two experts it must handle more than two classes. Its variable importance – which covariates decide which model applies – is what get_varimp returns for a fitted model, and a simple oracle such as setup_CART makes the partition itself readable.
Supports regression and binary classification.
Reference: Valdes, Interian, Gennatas & van der Laan, "Conditional Super Learner", IEEE Transactions on Pattern Analysis and Machine Intelligence (2022). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/TPAMI.2021.3131976")}
ConditionalSuperLearnerHyperparameters object.
EDG
csl_hyperparams <- setup_ConditionalSuperLearner(
base_learners = list(setup_GLM(), setup_CART())
)
csl_hyperparams
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.