View source: R/dimension_reduction.R
predict_spca | R Documentation |
Reduce dimensions of new data using the model from spca(). See original paper (https://tibshirani.su.domains/ftp/spca.pdf) for details.
predict_spca(df, X_cols, y_col = "CASE_CNTL", model)
df |
(data.frame) NEBCS data |
X_cols |
(array<character>) reduced columns found from spca(). Should use spca()$cols. |
y_col |
(character) (default='CASE_CNTL') column name for the response variable |
model |
(Object) best model found from spca(). Should use spca()$model. |
(array<numeric>) Pollutants reduced to one dimension using results from spca().
res = spca(...) predict_spca(df, X_cols=res$cols, model=res$model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.