Scales predictors.
.scalePredictors(scale, preds, data)
Either NA
(default), or TRUE
or FALSE
. If TRUE
, the predictors will be centered and scaled by dividing by subtracting their means then dividing by their standard deviations. The means and standard deviations will be returned in the model object under an element named "scales
". For example, if you do something like model <- trainGLM(data, scale=TRUE)
, then you can get the means and standard deviations using model$scales$means
and model$scales$sds
. If FALSE
, no scaling is done. If NA
(default), then the function will check to see if non-factor predictors have means ~0 and standard deviations ~1. If not, then a warning will be printed, but the function will continue to do it's operations.
A character vector with names of the predictors in data
.
A data frame.