Kruskal-Wallis rank sum test filter calling stats::kruskal.test().

The filter value is -log10(p) where p is the \(p\)-value. This transformation is necessary to ensure numerical stability for very small \(p\)-values.

See also

Super class

mlr3filters::Filter -> FilterKruskalTest

Methods

Public methods

Inherited methods

Method new()

Create a FilterKruskalTest object.

Usage

FilterKruskalTest$new(
  id = "kruskal_test",
  task_type = "classif",
  param_set = ParamSet$new(list(ParamFct$new("na.action", default = "na.omit", levels =
    c("na.omit", "na.fail", "na.exclude", "na.pass")))),
  packages = "stats",
  feature_types = c("integer", "numeric")
)

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

FilterKruskalTest$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

task = mlr3::tsk("iris") filter = flt("kruskal_test") filter$calculate(task) as.data.table(filter)
#> feature score #> 1: Petal.Width 28.48654 #> 2: Petal.Length 28.31840 #> 3: Sepal.Length 21.04970 #> 4: Sepal.Width 13.80430
# transform to p-value 10^(-filter$scores)
#> Petal.Width Petal.Length Sepal.Length Sepal.Width #> 3.261796e-29 4.803974e-29 8.918734e-22 1.569282e-14