step_select_kruskal {scimo} | R Documentation |
Feature selection step using Kruskal test
Description
Select variables with the lowest (adjusted) p-value of a Kruskal-Wallis test against an outcome.
Usage
step_select_kruskal(
recipe,
...,
role = NA,
trained = FALSE,
outcome = NULL,
n_kept = NULL,
prop_kept = NULL,
cutoff = NULL,
correction = "none",
res = NULL,
skip = FALSE,
id = rand_id("select_kruskal")
)
## S3 method for class 'step_select_kruskal'
tidy(x, ...)
Arguments
recipe |
A recipe object. The step will be added to the sequence of operations for this recipe. |
... |
One or more selector functions to choose variables
for this step. See |
role |
Not used by this step since no new variables are created. |
trained |
A logical to indicate if the quantities for preprocessing have been estimated. |
outcome |
Name of the variable to perform the test against. |
n_kept |
Number of variables to keep. |
prop_kept |
A numeric value between 0 and 1 representing the proportion
of variables to keep. |
cutoff |
Threshold beyond which (below or above) the variables are discarded. |
correction |
Multiple testing correction method. One of
|
res |
This parameter is only produced after the recipe has been trained. |
skip |
A logical. Should the step be skipped when the
recipe is baked by |
id |
A character string that is unique to this step to identify it. |
x |
A |
Value
An updated version of recipe with the new step added to the sequence of any existing operations.
Author(s)
Antoine Bichat
Examples
rec <-
iris %>%
recipe(formula = Species ~ .) %>%
step_select_kruskal(all_numeric_predictors(), outcome = "Species",
correction = "fdr", prop_kept = 0.5) %>%
prep()
rec
tidy(rec, 1)
bake(rec, new_data = NULL)