mlr_filters_relief {mlr3filters}R Documentation

RELIEF Filter

Description

Information gain filter calling FSelectorRcpp::relief() in package FSelectorRcpp.

Super class

mlr3filters::Filter -> FilterRelief

Methods

Public methods

Inherited methods

Method new()

Create a FilterRelief object.

Usage
FilterRelief$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
FilterRelief$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Note

This filter can handle missing values in the features. However, the resulting filter scores may be misleading or at least difficult to compare if some features have a large proportion of missing values.

If a feature has no non-missing observation, the resulting score will be (close to) 0.

See Also

Other Filter: Filter, mlr_filters, mlr_filters_anova, mlr_filters_auc, mlr_filters_boruta, 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_jmi, mlr_filters_jmim, mlr_filters_kruskal_test, mlr_filters_mim, mlr_filters_mrmr, mlr_filters_njmim, mlr_filters_performance, mlr_filters_permutation, mlr_filters_selected_features, mlr_filters_univariate_cox, mlr_filters_variance

Examples

if (requireNamespace("FSelectorRcpp")) {
  ## Relief (default)
  task = mlr3::tsk("iris")
  filter = flt("relief")
  filter$calculate(task)
  head(filter$scores, 3)
  as.data.table(filter)
}

if (mlr3misc::require_namespaces(c("mlr3pipelines", "FSelectorRcpp", "rpart"), quietly = TRUE)) {
  library("mlr3pipelines")
  task = mlr3::tsk("iris")

  # Note: `filter.frac` is selected randomly and should be tuned.

  graph = po("filter", filter = flt("relief"), filter.frac = 0.5) %>>%
    po("learner", mlr3::lrn("classif.rpart"))

  graph$train(task)
}

[Package mlr3filters version 0.8.0 Index]