This learner screens covariates based on their variable importance, where the
importance values are obtained from the learner
. Any learner with an
importance
method can be used. The set of learners with support for
importance
can be found with sl3_list_learners("importance")
.
Like all other screeners, this learner is intended for use in a
Pipeline
, so the output from this learner (i.e., the selected
covariates) can be used as input for the next learner in the pipeline.
A learner object inheriting from Lrnr_base
with
methods for training and prediction. For a full list of learner
functionality, see the complete documentation of Lrnr_base
.
learner
: An instantiated learner that supports variable importance.
The set of learners with this support can be obtained via
sl3_list_learners("importance")
.
num_screen = 5
: The top n number of "most impotant" variables to
retain.
...
: Other parameters passed to the learner
's
importance
function.
Other Learners:
Custom_chain
,
Lrnr_HarmonicReg
,
Lrnr_arima
,
Lrnr_bartMachine
,
Lrnr_base
,
Lrnr_bayesglm
,
Lrnr_bilstm
,
Lrnr_caret
,
Lrnr_cv_selector
,
Lrnr_cv
,
Lrnr_dbarts
,
Lrnr_define_interactions
,
Lrnr_density_discretize
,
Lrnr_density_hse
,
Lrnr_density_semiparametric
,
Lrnr_earth
,
Lrnr_expSmooth
,
Lrnr_gam
,
Lrnr_ga
,
Lrnr_gbm
,
Lrnr_glm_fast
,
Lrnr_glm_semiparametric
,
Lrnr_glmnet
,
Lrnr_glmtree
,
Lrnr_glm
,
Lrnr_grfcate
,
Lrnr_grf
,
Lrnr_gru_keras
,
Lrnr_gts
,
Lrnr_h2o_grid
,
Lrnr_hal9001
,
Lrnr_haldensify
,
Lrnr_hts
,
Lrnr_independent_binomial
,
Lrnr_lightgbm
,
Lrnr_lstm_keras
,
Lrnr_mean
,
Lrnr_multiple_ts
,
Lrnr_multivariate
,
Lrnr_nnet
,
Lrnr_nnls
,
Lrnr_optim
,
Lrnr_pca
,
Lrnr_pkg_SuperLearner
,
Lrnr_polspline
,
Lrnr_pooled_hazards
,
Lrnr_randomForest
,
Lrnr_ranger
,
Lrnr_revere_task
,
Lrnr_rpart
,
Lrnr_rugarch
,
Lrnr_screener_augment
,
Lrnr_screener_coefs
,
Lrnr_screener_correlation
,
Lrnr_sl
,
Lrnr_solnp_density
,
Lrnr_solnp
,
Lrnr_stratified
,
Lrnr_subset_covariates
,
Lrnr_svm
,
Lrnr_tsDyn
,
Lrnr_ts_weights
,
Lrnr_xgboost
,
Pipeline
,
Stack
,
define_h2o_X()
,
undocumented_learner
data(mtcars)
mtcars_task <- sl3_Task$new(
data = mtcars,
covariates = c(
"cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "am",
"gear", "carb"
),
outcome = "mpg"
)
glm_lrnr <- make_learner(Lrnr_glm)
# screening based on \code{\link{Lrnr_ranger}} variable importance
ranger_lrnr_importance <- Lrnr_ranger$new(importance = "impurity_corrected")
ranger_importance_screener <- Lrnr_screener_importance$new(
learner = ranger_lrnr_importance, num_screen = 3
)
ranger_screen_glm_pipe <- Pipeline$new(ranger_importance_screener, glm_lrnr)
ranger_screen_glm_pipe_fit <- ranger_screen_glm_pipe$train(mtcars_task)
# screening based on \code{\link{Lrnr_randomForest}} variable importance
rf_lrnr <- Lrnr_randomForest$new()
rf_importance_screener <- Lrnr_screener_importance$new(
learner = rf_lrnr, num_screen = 3
)
rf_screen_glm_pipe <- Pipeline$new(rf_importance_screener, glm_lrnr)
rf_screen_glm_pipe_fit <- rf_screen_glm_pipe$train(mtcars_task)
# screening based on \code{\link{Lrnr_randomForest}} variable importance
xgb_lrnr <- Lrnr_xgboost$new()
xgb_importance_screener <- Lrnr_screener_importance$new(
learner = xgb_lrnr, num_screen = 3
)
xgb_screen_glm_pipe <- Pipeline$new(xgb_importance_screener, glm_lrnr)
xgb_screen_glm_pipe_fit <- xgb_screen_glm_pipe$train(mtcars_task)