This module provides a class for principal components analysis (PCA).
PCA is an orthonormal, linear transform (i.e., a rotation) that maps the data to a new coordinate system such that the maximal variability of the data lies on the first coordinate (or the first principal component), the second greatest variability is projected onto the second coordinate, and so on. The resulting data has unit covariance (i.e., it is decorrelated). This technique can be used to reduce the dimensionality of the data.
More specifically, the data is projected onto the eigenvectors of the covariance matrix.
Compute the SVD PCA of an array-like thing over axis.
Parameters : | data : ndarray-like (np.float)
axis : int, optional
mask : ndarray-like (np.bool), optional
ncomp : {None, int}, optional
standardize : bool, optional
design_keep : None or ndarray, optional
design_resid : str or None or ndarray, optional
tol_ratio : float, optional
|
---|---|
Returns : | results : dict
|
Notes
See pca_image.m from fmristat for Keith Worsley’s code on which some of this is based.
See: http://en.wikipedia.org/wiki/Principal_component_analysis for some inspiration for naming - particularly ‘basis_vectors’ and ‘basis_projections’
Compute the PCA of an image over a specified axis
Parameters : | img : Image
axis : str or int
mask : Image, optional
ncomp : {None, int}, optional
standardize : bool, optional
design_keep : None or ndarray, optional
design_resid : str or None or ndarray, optional
tol_ratio : float, optional
|
---|---|
Returns : | results : dict
|