Fast Principal Component Analysis for high dimensional data

버전 2.2 (2.39 KB) 작성자: dpblum
Implementation of PCA that is much faster in analysis of high-dimensional data, compared to MATLAB's or Python's in-built function.
다운로드 수: 398
업데이트 날짜: 2021/8/2

라이선스 보기

[COEFF,SCORE,LATENT,EXPLAINED] = fastpca(data)
Fast Principal Component Analysis for very high dimensional data (e.g. voxel-level analysis of neuroimaging data), implemented according to C. Bishop's book "Pattern Recognition and Machine Learning", p. 570. For high-dimensional data, fastpca.m is substantially faster than MATLAB's in-build function pca.m.
According to MATLAB's PCA terminology, fastpca.m needs an input-matrix with each of N rows representing an observation (e.g. subject) and each of p columns a dimension (e.g. voxel). fastpca.m returns principal component (PC) loadings COEFF, PC scores (SCORE), variances explained by the PCs cumulatively in absolute values (LATENT) and in percent (EXPLAINED). Additionally, fastpca returns the PC loading of the small covariance matrix (COEFFs).
Decrease in computation time results from calculating PCs first from the (usually smaller NxN) covariance matrix of the transposed input-matrix "data" and then projecting them onto the observations, in order to obtain the PCs of the large DxD covariance matrix.
By default, fastpca removes the mean of each observation. In this implementation of fastpca, I skipped calculation of Hotelling’s T-Squared Statistic.
Example:
In medical image analysis, there are often datasets with few to several hundreds of observations (subjects) and hundreds of thousands dimensions (voxels). As an example, I compare MATLABs PCA and fastpca.m using a random matrix with 300 rows and 500000 columns:
data = rand(300,500000);
tic; [COEFF,SCORE,LATENT,~,EXPLAINED] = pca(data); toc
>> Elapsed time is 37.295108 seconds.
tic; [COEFF,SCORE,LATENT,EXPLAINED] = fastpca(data); toc
>> Elapsed time is 4.853614 seconds.
Version 2.2 from 02/08/2021: fastpca is now implemented in Python and available on GitHub: https://github.com/dpblum/fastpca.git
Version 1.21 from 12/07/2021.
Version 1.0 from 08/08/2019.
Implemented by Dominik Blum.
E-Mail: dominikblum1987@gmail.com

인용 양식

dpblum (2024). Fast Principal Component Analysis for high dimensional data (https://www.mathworks.com/matlabcentral/fileexchange/72396-fast-principal-component-analysis-for-high-dimensional-data), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
2.2

fastpca is now implemented in Python and available on GitHub: https://github.com/dpblum/fastpca.git

2.1

fastpca is now implemented in Python and available on GitHub: https://github.com/dpblum/fastpca.git

1.211

.

1.2

.

1.1

.

1.0