Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/htpusa/spca
Sparse Principal Component Analysis via penalised matrix decomposition
https://github.com/htpusa/spca
dimensionality-reduction principal-component-analysis sparse-principal-component-analysis
Last synced: 20 days ago
JSON representation
Sparse Principal Component Analysis via penalised matrix decomposition
- Host: GitHub
- URL: https://github.com/htpusa/spca
- Owner: htpusa
- Created: 2024-02-01T12:57:10.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-12T11:54:57.000Z (8 months ago)
- Last Synced: 2024-04-12T18:46:11.824Z (8 months ago)
- Topics: dimensionality-reduction, principal-component-analysis, sparse-principal-component-analysis
- Language: MATLAB
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spca: Sparse Principal Component Analysis via penalised matrix decomposition
MATLAB implementation of the sparse principal component analysis method proposed in Witten et al. (2009).
## Quick start
```MATLAB
load spca_example
[coeff,score] = spca(X,0.5,'K',2);
```X is a data matrix with observations in rows, the second argument is a parameter between 0 and 1 controlling coefficient vector sparsity: 0 is maximal sparsity, 1 is no sparsity. The name-value argument 'K' controls how many principal components are calculated.
## Optimising the sparsity parameter
```MATLAB
c = tunespca(X,'K',2);
[coeff,score] = spca(X,c,'K',2);
```The function `tunespca` finds optimal values for the sparsity parameter using the missing value imputation scheme proposed in Witten et al. (2009). The parameter is optimised sequentially for each successive component, `c(1)`is the optimal value for the first component etc.
For more information about the arguments and behaviour, see
```MATLAB
help spca
```
and the example script `spca_example.m`.## References
Witten, Daniela M., Robert Tibshirani, and Trevor Hastie. "A penalized matrix decomposition, with applications to sparse principal components and canonical correlation analysis." Biostatistics 10.3 (2009): 515-534.