d_SPCA: Sparse Principal Component Analysis

View source: R/d_SPCA.R

d_SPCAR Documentation

Sparse Principal Component Analysis

Description

Perform sparse and/or non-negative PCA or cumulative PCA decomposition using nsprcomp::nsprcomp or nsprcomp::nscumcomp respectively

Usage

d_SPCA(
  x,
  x.test = NULL,
  k = 1,
  nz = floor(0.5 * NCOL(x)),
  nneg = FALSE,
  gamma = 0,
  method = c("cumulative", "vanilla"),
  scale = TRUE,
  center = TRUE,
  verbose = TRUE,
  ...
)

Arguments

x

Input matrix

x.test

Optional test set. Will be projected on to SPCA basis

k

Integer vector of length 1 or greater. N of components to return If set to 0, th determines eigenvalue below which PCs are ignored

nz

Integer: Upper bound on non-zero loadings. See nsprcomp::nscumcomp("k")

nneg

Logical: If TRUE, calculate non-negative loadings only. Default = FALSE

gamma

Float (>0): Penalty on the divergence from otrhonormality of the pseudo-rotation matrix. Default = 0, i.e. no penalty. May need to increase with collinear features.

method

Character: "cumulative" or "vanilla" sparse PCA. Default = "cumulative"

scale

Logical: If TRUE, scale input data before projecting. Default = TRUE

center

Logical: If TRUE, also center input data if scale is TRUE. Default = FALSE

verbose

Logical: If TRUE, print messages to screen. Default = TRUE

...

Additional parameters to be passed to fastSPCA::fastSPCA

Details

Project scaled variables to sparse and/or non-negative PCA components. Input must be n by p, where n represents number of cases, and p represents number of features. SPCA will be applied to the transpose of the n x p matrix.

Value

rtDecom object

Author(s)

E.D. Gennatas

See Also

Other Decomposition: d_H2OAE(), d_H2OGLRM(), d_ICA(), d_Isomap(), d_KPCA(), d_LLE(), d_MDS(), d_NMF(), d_PCA(), d_SVD(), d_TSNE(), d_UMAP()


egenn/rtemis documentation built on Dec. 17, 2024, 6:16 p.m.