|
SHOGUN
v1.1.0
|
Preprocessor PCACut performs principial component analysis on the input vectors and keeps only the n eigenvectors with eigenvalues above a certain threshold.
On preprocessing the stored covariance matrix is used to project vectors into eigenspace only returning vectors of reduced dimension n. Optional whitening is performed.
This is only useful if the dimensionality of the data is rather low, as the covariance matrix is of size num_feat*num_feat. Note that vectors don't have to have zero mean as it is substracted.

Public Member Functions | |
| CPCA (bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6) | |
| virtual | ~CPCA () |
| virtual bool | init (CFeatures *features) |
| virtual void | cleanup () |
| virtual SGMatrix< float64_t > | apply_to_feature_matrix (CFeatures *features) |
| virtual SGVector< float64_t > | apply_to_feature_vector (SGVector< float64_t > vector) |
| SGMatrix< float64_t > | get_transformation_matrix () |
| SGVector< float64_t > | get_eigenvalues () |
| SGVector< float64_t > | get_mean () |
| virtual const char * | get_name () const |
| virtual EPreprocessorType | get_type () const |
Public Member Functions inherited from CDimensionReductionPreprocessor | |
| CDimensionReductionPreprocessor () | |
| CDimensionReductionPreprocessor (CEmbeddingConverter *converter) | |
| virtual | ~CDimensionReductionPreprocessor () |
| void | set_target_dim (int32_t dim) |
| int32_t | get_target_dim () const |
| void | set_distance (CDistance *distance) |
| CDistance * | get_distance () const |
| void | set_kernel (CKernel *kernel) |
| CKernel * | get_kernel () const |
Public Member Functions inherited from CSimplePreprocessor< float64_t > | |
| CSimplePreprocessor () | |
| virtual EFeatureClass | get_feature_class () |
| return that we are simple features (just fixed size matrices) More... | |
| virtual EFeatureType | get_feature_type () |
| return feature type More... | |
Public Member Functions inherited from CPreprocessor | |
| CPreprocessor () | |
| virtual | ~CPreprocessor () |
Public Member Functions inherited from CSGObject | |
| CSGObject () | |
| CSGObject (const CSGObject &orig) | |
| virtual | ~CSGObject () |
| virtual bool | is_generic (EPrimitiveType *generic) const |
| template<class T > | |
| void | set_generic () |
| void | unset_generic () |
| virtual void | print_serializable (const char *prefix="") |
| virtual bool | save_serializable (CSerializableFile *file, const char *prefix="") |
| virtual bool | load_serializable (CSerializableFile *file, const char *prefix="") |
| void | set_global_io (SGIO *io) |
| SGIO * | get_global_io () |
| void | set_global_parallel (Parallel *parallel) |
| Parallel * | get_global_parallel () |
| void | set_global_version (Version *version) |
| Version * | get_global_version () |
| SGVector< char * > | get_modelsel_names () |
| char * | get_modsel_param_descr (const char *param_name) |
| index_t | get_modsel_param_index (const char *param_name) |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
| template<> | |
| void | set_generic () |
Protected Member Functions | |
| void | init () |
Protected Member Functions inherited from CDimensionReductionPreprocessor | |
| void | init () |
Protected Member Functions inherited from CSGObject | |
| virtual void | load_serializable_pre () throw (ShogunException) |
| virtual void | load_serializable_post () throw (ShogunException) |
| virtual void | save_serializable_pre () throw (ShogunException) |
| virtual void | save_serializable_post () throw (ShogunException) |
Protected Attributes | |
| SGMatrix< float64_t > | m_transformation_matrix |
| int32_t | num_dim |
| int32_t | num_old_dim |
| SGVector< float64_t > | m_mean_vector |
| SGVector< float64_t > | m_eigenvalues_vector |
| bool | m_initialized |
| bool | m_whitening |
| EPCAMode | m_mode |
| float64_t | thresh |
Protected Attributes inherited from CDimensionReductionPreprocessor | |
| int32_t | m_target_dim |
| CDistance * | m_distance |
| CKernel * | m_kernel |
| CEmbeddingConverter * | m_converter |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
| CPCA | ( | bool | do_whitening = false, |
| EPCAMode | mode = FIXED_NUMBER, |
||
| float64_t | thresh = 1e-6 |
||
| ) |
apply preprocessor to feature matrix
| features | features |
Reimplemented from CDimensionReductionPreprocessor.
apply preprocessor to feature vector
| vector | feature vector |
Reimplemented from CDimensionReductionPreprocessor.
|
virtual |
|
virtual |
Reimplemented from CDimensionReductionPreprocessor.
|
virtual |
Reimplemented from CDimensionReductionPreprocessor.
|
virtual |
initialize preprocessor from features
| features |
Reimplemented from CDimensionReductionPreprocessor.