View source: R/preproc-generics.R
| transform | R Documentation |
Apply a fitted preprocessing pipeline to new data. The preprocessing
object must have been fitted using fit() or fit_transform() before
calling this function.
transform(object, X, ...)
object |
A fitted preprocessing object |
X |
A matrix or data frame to transform |
... |
Additional arguments passed to methods |
The transformed data matrix
fit(), fit_transform(), inverse_transform()
# Transform new data with fitted preprocessor
X_train <- matrix(rnorm(100), 10, 10)
X_test <- matrix(rnorm(50), 5, 10)
preproc <- center()
fitted_preproc <- fit(preproc, X_train)
X_test_transformed <- transform(fitted_preproc, X_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.