View source: R/31_pre_processing_functions.R
estimate_leading_pc | R Documentation |
Estimates the leading principal component of the input matrix using dense or sparse PCA.
estimate_leading_pc(control, pca_method = c("dense_pca", "sparse_pca"))
control |
A matrix or data frame. Each row is a sample, and each column is a feature. |
pca_method |
Character. PCA method to use. Options are |
For low-dimensional settings (\le
30 features), the method automatically switches to dense PCA.
For sparse PCA, the function uses the PMA::SPC.cv
cross-validation method.
A normalized numeric vector representing the leading principal component direction.
## Not run:
X <- matrix(rnorm(100), nrow = 20)
estimate_leading_pc(X, pca_method = "dense_pca")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.