mlr_filters_permutation | R Documentation |
The permutation filter randomly permutes the values of a single feature in a
mlr3::Task to break the association with the response. The permuted
feature, together with the unmodified features, is used to perform a
mlr3::resample()
. The permutation filter score is the difference between
the aggregated performance of the mlr3::Measure and the performance
estimated on the unmodified mlr3::Task.
standardize
logical(1)
Standardize feature importance by maximum score.
nmc
integer(1)
Number of Monte-Carlo iterations to use in computing the feature importance.
mlr3filters::Filter
-> FilterPermutation
learner
(mlr3::Learner)
resampling
(mlr3::Resampling)
measure
(mlr3::Measure)
new()
Create a FilterPermutation object.
FilterPermutation$new( learner = mlr3::lrn("classif.featureless"), resampling = mlr3::rsmp("holdout"), measure = NULL )
learner
(mlr3::Learner)
mlr3::Learner to use for model fitting.
resampling
(mlr3::Resampling)
mlr3::Resampling to be used within resampling.
measure
(mlr3::Measure)
mlr3::Measure to be used for evaluating the performance.
clone()
The objects of this class are cloneable with this method.
FilterPermutation$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_importance
,
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_relief
,
mlr_filters_selected_features
,
mlr_filters_variance
,
mlr_filters
if (requireNamespace("rpart")) { learner = mlr3::lrn("classif.rpart") resampling = mlr3::rsmp("holdout") measure = mlr3::msr("classif.acc") filter = flt("permutation", learner = learner, measure = measure, resampling = resampling, nmc = 2) task = mlr3::tsk("iris") filter$calculate(task) as.data.table(filter) } if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) { library("mlr3pipelines") task = mlr3::tsk("iris") # Note: `filter.frac` is selected randomly and should be tuned. graph = po("filter", filter = flt("permutation", nmc = 2), filter.frac = 0.5) %>>% po("learner", mlr3::lrn("classif.rpart")) graph$train(task) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.