View source: R/170_Decomposition.R
| apply_decomp | R Documentation |
Apply a fitted decomposition to new data for algorithms that support this.
apply_decomp(decom, new_data, execution_config = NULL, verbosity = 1L)
decom |
Decomposition object. |
new_data |
Tabular data (data.frame, data.table, or tibble): New data to which the decomposition will be applied. |
execution_config |
Optional |
verbosity |
Integer: Verbosity level |
A fit is learned on the columns decom@config@features names, so only those
columns of new_data are transformed; the remaining columns are returned
unchanged, alongside the learned components, in the layout
[kept features, components]. decomp() resolves an unset features to
the numeric columns and records them, so a fit it produced always names
them. A Decomposition assembled by hand with no features transforms
every column of new_data and returns only the components.
A data.frame of the learned components for new_data, preceded by any
feature columns that were not decomposed.
EDG
iris_pca <- decomp(exc(iris, "Species"), algorithm = "PCA")
apply_decomp(iris_pca, exc(iris, "Species"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.