CPCACut Class Reference

Inheritance diagram for CPCACut:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPCACut (int32_t do_whitening=0, float64_t thresh=1e-6)
virtual ~CPCACut ()
virtual bool init (CFeatures *f)
 initialize preprocessor from features
virtual bool load_init_data (FILE *src)
 initialize preprocessor from file
virtual bool save_init_data (FILE *dst)
 save init-data (like transforamtion matrices etc) to file
virtual void cleanup ()
 cleanup
virtual float64_tapply_to_feature_matrix (CFeatures *f)
virtual float64_tapply_to_feature_vector (float64_t *f, int32_t &len)

Protected Attributes

double * T
int32_t num_dim
int32_t num_old_dim
float64_tmean
bool initialized
 true when already initialized
int32_t do_whitening
float64_t thresh


Detailed Description

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.

Definition at line 36 of file PCACut.h.


Constructor & Destructor Documentation

CPCACut::CPCACut ( int32_t  do_whitening = 0,
float64_t  thresh = 1e-6 
)

constructor

Parameters:
do_whitening do whitening
thresh threshold

Definition at line 28 of file PCACut.cpp.

CPCACut::~CPCACut (  )  [virtual]

Definition at line 34 of file PCACut.cpp.


Member Function Documentation

float64_t * CPCACut::apply_to_feature_matrix ( CFeatures f  )  [virtual]

apply preproc on feature matrix result in feature matrix return pointer to feature_matrix, i.e. f->get_feature_matrix();

apply preproc on feature matrix result in feature matrix return pointer to feature_matrix, i.e. f->get_feature_matrix();

Implements CSimplePreProc< float64_t >.

Definition at line 184 of file PCACut.cpp.

float64_t * CPCACut::apply_to_feature_vector ( float64_t f,
int32_t &  len 
) [virtual]

apply preproc on single feature vector result in feature matrix

apply preproc on single feature vector result in feature matrix

Implements CSimplePreProc< float64_t >.

Definition at line 226 of file PCACut.cpp.

void CPCACut::cleanup (  )  [virtual]

cleanup

initialize preprocessor from features

Implements CPreProc.

Definition at line 175 of file PCACut.cpp.

bool CPCACut::init ( CFeatures f  )  [virtual]

initialize preprocessor from features

compute mean

A = 1.0*xy^T+A blas

Implements CPreProc.

Definition at line 41 of file PCACut.cpp.

bool CPCACut::load_init_data ( FILE *  src  )  [virtual]

initialize preprocessor from file

Implements CPreProc.

Definition at line 244 of file PCACut.cpp.

bool CPCACut::save_init_data ( FILE *  dst  )  [virtual]

save init-data (like transforamtion matrices etc) to file

Implements CPreProc.

Definition at line 259 of file PCACut.cpp.


Member Data Documentation

int32_t CPCACut::do_whitening [protected]

do whitening

Definition at line 79 of file PCACut.h.

bool CPCACut::initialized [protected]

true when already initialized

Definition at line 76 of file PCACut.h.

float64_t* CPCACut::mean [protected]

mean

Definition at line 73 of file PCACut.h.

int32_t CPCACut::num_dim [protected]

num dim

Definition at line 69 of file PCACut.h.

int32_t CPCACut::num_old_dim [protected]

num old dim

Definition at line 71 of file PCACut.h.

double* CPCACut::T [protected]

T

Definition at line 67 of file PCACut.h.

thresh

Definition at line 81 of file PCACut.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation