175 virtual const char*
get_name()
const {
return "PCA"; }
233 #endif // HAVE_EIGEN3
void set_memory_mode(EPCAMemoryMode e)
the class DimensionReductionPreprocessor, a base class for preprocessors used to lower the dimensiona...
EPCAMemoryMode m_mem_mode
SGVector< float64_t > m_mean_vector
void set_eigenvalue_zero_tolerance(float64_t eigenvalue_zero_tolerance=1e-15)
SGVector< float64_t > m_eigenvalues_vector
float64_t get_eigenvalue_zero_tolerance() const
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
CPCA(bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6, EPCAMethod method=AUTO, EPCAMemoryMode mem_mode=MEM_REALLOCATE)
SGMatrix< float64_t > m_transformation_matrix
virtual EPreprocessorType get_type() const
virtual const char * get_name() const
SGVector< float64_t > get_mean()
SGVector< float64_t > get_eigenvalues()
The class Features is the base class of all feature objects.
Preprocessor PCA performs principial component analysis on input feature vectors/matrices. When the init method in PCA is called with proper feature matrix X (with say N number of vectors and D feature dimension), a transformation matrix is computed and stored internally. This transformation matrix is then used to transform all D-dimensional feature vectors or feature matrices (with D feature dimensions) supplied via apply_to_feature_matrix or apply_to_feature_vector methods. This tranformation outputs the T-Dimensional approximation of all these input vectors and matrices (where T<=min(D,N)). The transformation matrix is essentially a DxT matrix, the columns of which correspond to the eigenvectors of the covariance matrix(XX') having top T eigenvalues.
EPCAMemoryMode get_memory_mode() const
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
float64_t m_eigenvalue_zero_tolerance
SGMatrix< float64_t > get_transformation_matrix()