mlr_filters_importance | R Documentation |
Variable Importance filter using embedded feature selection of machine learning algorithms. Takes a mlr3::Learner which is capable of extracting the variable importance (property "importance"), fits the model and extracts the importance values to use as filter scores.
mlr3filters::Filter
-> FilterImportance
learner
(mlr3::Learner)
Learner to extract the importance values from.
new()
Create a FilterImportance object.
FilterImportance$new(learner = mlr3::lrn("classif.featureless"))
learner
(mlr3::Learner)
Learner to extract the importance values from.
clone()
The objects of this class are cloneable with this method.
FilterImportance$clone(deep = FALSE)
deep
Whether to make a deep clone.
PipeOpFilter for filter-based feature selection.
Dictionary of Filters: mlr_filters
Other Filter:
Filter
,
mlr_filters_anova
,
mlr_filters_auc
,
mlr_filters_carscore
,
mlr_filters_carsurvscore
,
mlr_filters_cmim
,
mlr_filters_correlation
,
mlr_filters_disr
,
mlr_filters_find_correlation
,
mlr_filters_information_gain
,
mlr_filters_jmim
,
mlr_filters_jmi
,
mlr_filters_kruskal_test
,
mlr_filters_mim
,
mlr_filters_mrmr
,
mlr_filters_njmim
,
mlr_filters_performance
,
mlr_filters_permutation
,
mlr_filters_relief
,
mlr_filters_selected_features
,
mlr_filters_variance
,
mlr_filters
if (requireNamespace("rpart")) { task = mlr3::tsk("iris") learner = mlr3::lrn("classif.rpart") filter = flt("importance", learner = learner) filter$calculate(task) as.data.table(filter) } if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "mlr3learners"), quietly = TRUE)) { library("mlr3learners") library("mlr3pipelines") task = mlr3::tsk("sonar") learner = mlr3::lrn("classif.rpart") # Note: `filter.frac` is selected randomly and should be tuned. graph = po("filter", filter = flt("importance", learner = learner), filter.frac = 0.5) %>>% po("learner", mlr3::lrn("classif.log_reg")) graph$train(task) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.