step_svast: Applies Supervised-VAST scaling on numeric data

Description Usage Arguments Details Value References Examples

View source: R/s_vast.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
step_svast(
  recipe,
  ...,
  scaling = "autoscale",
  role = NA,
  trained = FALSE,
  outcome = NULL,
  means = NULL,
  sds = NULL,
  cvs = NULL,
  na_rm = TRUE,
  skip = FALSE,
  id = rand_id("svast")
)

Arguments

...

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.

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.

Details

supervised Variable Stability (s-VAST) scaling preforms centering and scaling followed by a weighting of each variable by the mean 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.

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.

References

Keun H. C., Ebbels T. M. D., Antti H., Bollard M. E., Beckonert O., Holmes E., et al. (2003). Improved analysis of multivariate data by variable stability scaling: application to NMR-based metabolic profiling. Anal. Chim. Acta 490, 265–276 10.1016/S0003-2670(03)00094-1 https://www.sciencedirect.com/science/article/abs/pii/S0003267003000941

Examples

1
2
3
4
5
6
7
8
# requires the recipes package
autoscale_svast <- 
  recipe(Species ~. , iris) %>%
  step_vast(all_predictors(), scaling = 'autoscale', outcome = 'Species')

pareto_svast <- 
  recipe(Species ~. , iris) %>%
  step_vast(all_predictors(), scaling = 'pareto', outcome = 'Species')

CVUA-RRW/NMRrecipes documentation built on Jan. 21, 2021, 1:53 a.m.