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.

Format

R6::R6Class inheriting from Filter.

Construction

FilterInformationGain$new()
mlr_filters$get("information_gain")
flt("information_gain")

See also

Examples

## InfoGain (default) task = mlr3::tsk("pima") filter = flt("information_gain") filter$calculate(task) head(filter$scores, 3)
#> glucose mass age #> 0.13436177 0.05227572 0.05023425
#> feature score #> 1: glucose 0.13436177 #> 2: mass 0.05227572 #> 3: age 0.05023425 #> 4: insulin 0.04105425 #> 5: pregnant 0.02715769 #> 6: triceps 0.02611189 #> 7: pedigree 0.01441496 #> 8: pressure 0.01386885
## GainRatio filterGR = flt("information_gain") filterGR$param_set$values = list("type" = "gainratio") filterGR$calculate(task) head(as.data.table(filterGR), 3)
#> feature score #> 1: glucose 0.09829336 #> 2: mass 0.08428940 #> 3: age 0.07257535