step_select_background {scimo} | R Documentation |
Feature selection step using background level
Description
Select features that exceed a background level in at least a defined number of samples.
Usage
step_select_background(
recipe,
...,
role = NA,
trained = FALSE,
background_level = NULL,
n_samples = NULL,
prop_samples = NULL,
res = NULL,
skip = FALSE,
id = rand_id("select_background")
)
## S3 method for class 'step_select_background'
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. |
background_level |
Background level to exceed. |
n_samples , prop_samples |
Count or proportion of samples in which a
feature exceeds |
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_background(all_numeric_predictors(),
background_level = 4, prop_samples = 0.5) %>%
prep()
rec
tidy(rec, 1)
bake(rec, new_data = NULL)