mlr3filters (version 0.3.0)

mlr_filters_information_gain: Information Gain Filter

Description

Information gain filter calling FSelectorRcpp::information_gain() in package FSelectorRcpp. Set parameter "type" to "gainratio" to calculate the gain ratio, or set to "symuncert" to calculate the symmetrical uncertainty (see FSelectorRcpp::information_gain()). Default is "infogain".

Argument equal defaults to FALSE for classification tasks, and to TRUE for regression tasks.

Arguments

Super class

mlr3filters::Filter -> FilterInformationGain

Methods

Public methods

Method new()

Create a FilterInformationGain object.

Usage

FilterInformationGain$new(
  id = "information_gain",
  task_type = c("classif", "regr"),
  param_set = ParamSet$new(list(ParamFct$new("type", levels = c("infogain",
    "gainratio", "symuncert"), default = "infogain"), ParamLgl$new("equal", default =
    FALSE), ParamLgl$new("discIntegers", default = TRUE), ParamInt$new("threads", lower =
    0L, default = 1L))),
  packages = "FSelectorRcpp",
  feature_types = c("integer", "numeric", "factor", "ordered")
)

Arguments

id

(character(1)) Identifier for the filter.

task_type

(character()) Types of the task the filter can operator on. E.g., "classif" or "regr".

param_set

(paradox::ParamSet) Set of hyperparameters.

packages

(character()) Set of required packages. Note that these packages will be loaded via requireNamespace(), and are not attached.

feature_types

(character()) Feature types the filter operates on. Must be a subset of mlr_reflections$task_feature_types.

Method clone()

The objects of this class are cloneable with this method.

Usage

FilterInformationGain$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

Dictionary of Filters: mlr_filters

Other Filter: Filter, mlr_filters_anova, mlr_filters_auc, mlr_filters_carscore, mlr_filters_cmim, mlr_filters_correlation, mlr_filters_disr, mlr_filters_find_correlation, mlr_filters_importance, 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_variance, mlr_filters

Examples

Run this code
# NOT RUN {
## InfoGain (default)
task = mlr3::tsk("pima")
filter = flt("information_gain")
filter$calculate(task)
head(filter$scores, 3)
as.data.table(filter)

## GainRatio

filterGR = flt("information_gain")
filterGR$param_set$values = list("type" = "gainratio")
filterGR$calculate(task)
head(as.data.table(filterGR), 3)
# }

Run the code above in your browser using DataLab