Split data into training and test sets, optionally standardizing by training set centers and standard deviations
Arguments
- data
data frame with rows as samples, columns as features
- test.id
integer vector of indices for test set. If
NULL
(default), all samples are used.- train.id
integer vector of indices for training set. If
NULL
(default), all samples are used.- standardize
logical; if
TRUE
, the training sets are standardized on features to have mean zero and unit variance. The test sets are standardized using the vectors of centers and standard deviations used in corresponding training sets.