step_outliers_remove | R Documentation |
step_outliers_remove
creates a specification of a recipe
step that will calculate the score of the row of selected columns using an aggregation function and filter the resulting tibble based on the filter function
step_outliers_remove( recipe, ..., aggregation_function = mean, score_dropout = 0.95, outliers_indexes = NULL, aggregation_results = NULL, col_names = NULL, role = NA, trained = FALSE, skip = TRUE, id = rand_id("outliers_remove") ) ## S3 method for class 'step_outliers_remove' tidy(x, ...)
recipe |
A recipe object. The step will be added to the sequence of operations for this recipe. |
... |
One or more selector functions to choose which
variables will be transformed. See |
aggregation_function |
a function that returns a value between 0 and 1 on an applied row |
score_dropout |
a value between 0 and 1 to decide outliers uses ">=" rule |
outliers_indexes |
placeholder for the tidy method |
aggregation_results |
a placeholder for the vector of probabilities |
col_names |
name of the columns being operated on, after filtering they will be removed |
role |
not defined for this function |
trained |
A logical to indicate if the quantities for preprocessing have been estimated. |
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 |
All columns in the data are sampled and returned by juice()
and bake()
.
All columns used in this step must be numeric with no missing data.
When used in modeling, users should strongly consider using the
option skip = TRUE
so that this operation is not
conducted outside of the training set.
An updated version of recipe
with the new step
added to the sequence of existing steps (if any), with the name on name_mutate
and the probabilities calculated. For the
tidy
method, a tibble with columns index
(the row indexes of the tibble), outliers
(the filtered outliers), aggregation_results
the "probabilities calculated".
library(recipes) library(tidy.outliers) rec <- recipe(mpg ~ ., data = mtcars) %>% step_outliers_maha(all_numeric_predictors()) %>% step_outliers_remove(contains(r"(.outliers)")) %>% prep(mtcars) bake(rec, new_data = NULL) tidy(rec, number = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.