preProcess(x, ...)## S3 method for class 'default':
preProcess(x,
method = c("center", "scale"),
thresh = 0.95,
pcaComp = NULL,
na.remove = TRUE,
k = 5,
knnSummary = mean,
outcome = NULL,
fudge = .2,
numUnique = 3,
verbose = FALSE,
...)
## S3 method for class 'preProcess':
predict(object, newdata, ...)
thresh
preProcess
y
have to estimate the Box-Cox transformation?fastICA
, such as n.comp
preProcess
results in a list with elementsx
BoxCoxTrans
method
thresh
method
includes "range" (and NULL
otherwise)W
and K
matrix of the decompositionThe operations are applied in this order: Box-Cox/Yeo-Johnson transformation, centering, scaling, range, imputation, PCA, ICA then spatial sign. This is a departure from versions of
If PCA is requested but centering and scaling are not, the values will still be centered and scaled. Similarly, when ICA is requested, the data are automatically centered and scaled.
k-nearest neighbor imputation is carried out by finding the k closest samples (Euclidian distance) in the training set. Imputation via bagging fits a bagged tree model for each predictor (as a function of all the others). This method is simple, accurate and accepts missing values, but it has much higher computational cost. Imputation via medians takes the median of each predictor in the training set, and uses them to fill missing values. This method is simple, fast, and accepts missing values, but treats each predictor independently, and may be inaccurate.
A warning is thrown if both PCA and ICA are requested. ICA, as implemented by the fastICA
package automatically does a PCA decomposition prior to finding the ICA scores.
The function will throw an error of any variables in x
has less than two unique values.
Kuhn (2008), Building predictive models in R using the caret (
Box, G. E. P. and Cox, D. R. (1964) An analysis of transformations (with discussion). Journal of the Royal Statistical Society B, 26, 211-252.
Box, G. E. P. and Tidwell, P. W. (1962) Transformation of the independent variables. Technometrics 4, 531-550.
Manly, B. L. (1976) Exponential data transformations. The Statistician, 25, 37 - 42.
Yeo, I-K. and Johnson, R. (2000). A new family of power transformations to improve normality or symmetry. Biometrika, 87, 954-959.
BoxCoxTrans
, expoTrans
boxcox
, prcomp
, fastICA
, spatialSign
data(BloodBrain)
# one variable has one unique value
preProc <- preProcess(bbbDescr)
preProc <- preProcess(bbbDescr[1:100,-3])
training <- predict(preProc, bbbDescr[1:100,-3])
test <- predict(preProc, bbbDescr[101:208,-3])
Run the code above in your browser using DataLab