This class implements Principal Component Analysis. More...
#include <mia/core/gsl_pca.hh>
Data Structures | |
struct | Result |
Public Member Functions | |
Result | analyze (const Matrix &signal) const |
PCA (unsigned max_pc, double energy_thresh_ratio) | |
void | set_eigenvalue_minimum (double min) |
This class implements Principal Component Analysis.
This class implements Principal Component Analysis by using the covariance matrix. The number of principal components to be evaluated can be defined in two ways: Either a hard number is given in the constructor, or the energy ratio is defined. In both cases PC are added starting from the component with the eigenvalue with the largest absolute value of the covariance matrix. In the first case the requested number of components is returned, unless smaller eigenvalues have a lower value than a given threshold value (default 1e-9). In the energy-ratio based case values are added as long as the ratio of the sum of the added eigenvalues with respect to the sum of all eigenvalues is below the user-defined ratio.
Definition at line 47 of file gsl_pca.hh.
gsl::PCA::PCA | ( | unsigned | max_pc, |
double | energy_thresh_ratio | ||
) |
Construct the PCA analysis
max_pc | maximum number of principal components to be returned. if this parameter is set to zero, then the number is estimated based on the energy ration given in the secons parameter |
energy_thresh_ratio | - if the number of principal components is to be evaluated automatically, then this value defines the condition when to stop adding components. The value must be in the range (0,1). |
Run the PCA on a given input data set.
signal | the input data the signals to be separated are stored in the columns |
void gsl::PCA::set_eigenvalue_minimum | ( | double | min | ) |
Set an alternative threshold for eigenvalues to be ignored.
min | new minimum for acceptable eigenvalue values. |