predict_spca: Reduce dimensions of new data using the model from spca()....

View source: R/dimension_reduction.R

predict_spcaR Documentation

Reduce dimensions of new data using the model from spca(). See original paper (https://tibshirani.su.domains/ftp/spca.pdf) for details.

Description

Reduce dimensions of new data using the model from spca(). See original paper (https://tibshirani.su.domains/ftp/spca.pdf) for details.

Usage

predict_spca(df, X_cols, y_col = "CASE_CNTL", model)

Arguments

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.

Value

(array<numeric>) Pollutants reduced to one dimension using results from spca().

Examples

res = spca(...)
predict_spca(df, X_cols=res$cols, model=res$model)

paulsavala/nebcs documentation built on March 20, 2022, 9:24 a.m.