Concept
np is numpy. axis=0 means that getting means of each column.
Principal component analysis (PCA) is the singular value decomposition (SVD) of this centered data.
The columns of
Dimension reduction of
Scikit-learn
In sklearn.decomposition.PCA, parameter n_components is
Attribute singular_values_ is singular values of SVD.
Attribute components_ is right singular vectors of SVD.
Dimension reduction by fit_transform(X) is
Reference
- The Elements of Statistical Learning, 14.5.1 Principal Components
- numpy.linalg.svd
- sklearn.decomposition.PCA