step_svast creates a specification of a recipe step that will perform x-VAST scaling on the columns

step_xvast(
  recipe,
  ...,
  scaling = "autoscale",
  role = NA,
  trained = FALSE,
  outcome = NULL,
  means = NULL,
  sds = NULL,
  cvs = NULL,
  na_rm = TRUE,
  skip = FALSE,
  id = rand_id("xvast")
)

# S3 method for step_xvast
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 which variables are affected by the step. See selections() for more details. For the tidy method, these are not currently used.

scaling

Either autoscale or pareto. Controls the scaling method. See notes below.

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

When a single outcome is available, character string or call to dplyr::vars() can be used to specify a single outcome variable.

means

A named numeric vector of means. This is NULL until computed by prep.recipe().

sds

A named numeric vector of stadard deviations. This is NULL until computed by prep.recipe().

cvs

A named numeric vector of variation coeficients. This is NULL until computed by prep.recipe().

na_rm

A logical value indicating whether NA values should be removed when computing the standard deviation and mean.

skip

A logical. Should the step be skipped when the recipe is baked by bake.recipe()? While all operations are baked when prep.recipe() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations

id

A character string that is unique to this step to identify it.

x

A step_xvast object.

Value

An updated version of recipe with the new step added to the sequence of existing steps (if any). For the tidy method, a tibble with columns terms (the selectors or variables selected), value (the standard deviations and means), and statistic for the type of value.

Details

supervised maximum Variable Stability (x-VAST) scaling preforms centering and scaling followed by a weighting of each variable by the maximum of the class-specific variation coeficients.

The argument scaling controls which scaling method should be used before variable weighting. autoscale will perform mean-centering and standard deviation scaling while pareto will scale by the square-root of the standard deviation.

References

Yang, J., Zhao, X., Lu, X., Lin, X., & Xu, G. (2015). A data preprocessing strategy for metabolomics to reduce the mask effect in data analysis. Frontiers in molecular biosciences, 2, 4. https://doi.org/10.3389/fmolb.2015.00004 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4428451/

Examples

library(tidySpectR) library(recipes) autoscale_xvast <- recipe(Species ~. , iris) %>% step_xvast(all_predictors(), scaling = 'autoscale', outcome = 'Species') pareto_svast <- recipe(Species ~. , iris) %>% step_xvast(all_predictors(), scaling = 'pareto', outcome = 'Species')