View source: R/recipe_steps_robust_gandh.R
| step_robust_gandh | R Documentation |
Creates a recipe step applying robust_gandh() to the selected variables.
The rQLS fit and all standardization constants are estimated during
prep() on the training data and applied unchanged during bake().
step_robust_gandh(
recipe,
...,
role = NA,
trained = FALSE,
n_quantiles = 10,
cutoff = NULL,
max_iter = 50,
tol = 1e-06,
standardize = TRUE,
res = NULL,
columns = NULL,
skip = FALSE,
id = recipes::rand_id("robust_gandh")
)
recipe |
A recipe object. The step will be added to the sequence of operations for this recipe. |
... |
One or more selector functions to choose the predictors (for
example, the spectral channels). See |
role |
Not used by this step, since no new variables are created. |
trained |
A logical indicating whether the step has been trained. |
n_quantiles |
Number of fitting quantiles, an integer from 4 to 20. Default is 10, as recommended for rQLS in the paper. |
cutoff |
Positive, finite Tukey biweight cutoff on the median/MAD
standardized input scale. |
max_iter |
Maximum number of trimming/refitting iterations per cutoff. Default is 50. |
tol |
Positive, finite relative tolerance for convergence. Default is 1e-6. |
standardize |
A logical value: standardize the transformed variables
by the mean and standard deviation of the inliers ( |
res |
The fitted transformation, stored once the step has been trained. |
columns |
The names of the selected columns, stored once the step 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. |
Selected columns are replaced in place. Missing values stay missing and
variables without enough observations or spread are left unchanged, as
in robust_gandh(). tidy() returns terms, location, scale, g,
h and id; location and scale are on the original input scale.
An updated version of recipe with the new step added to the
sequence of existing steps.
Christian L. Goueguel
robust_gandh(), step_robust_boxcox(), step_robust_yeojohnson()
data(forageLIBS)
contents <- forageLIBS[c("Ca", "K", "P", "Mn")]
rec <- recipes::recipe(~ ., data = contents[1:300, ]) |>
step_robust_gandh(recipes::all_numeric_predictors())
trained <- recipes::prep(rec)
recipes::bake(trained, new_data = contents[301:368, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.