Preprocessor PruneVarSubMean will substract the mean and remove features that have zero variance.
It will optionally normalize standard deviation of features to 1 (by dividing by standard deviation of the feature)
Definition at line 30 of file PruneVarSubMean.h.
Public Member Functions | |
CPruneVarSubMean (bool divide=true) | |
virtual | ~CPruneVarSubMean () |
virtual bool | init (CFeatures *f) |
initialize preprocessor from features | |
virtual void | cleanup () |
cleanup | |
virtual float64_t * | apply_to_feature_matrix (CFeatures *f) |
virtual float64_t * | apply_to_feature_vector (float64_t *f, int32_t &len) |
virtual const char * | get_name () |
Protected Attributes | |
int32_t * | idx |
float64_t * | mean |
float64_t * | std |
int32_t | num_idx |
bool | divide_by_std |
bool | initialized |
true when already initialized |
CPruneVarSubMean | ( | bool | divide = true |
) |
constructor
divide | if division shall be made |
Definition at line 21 of file PruneVarSubMean.cpp.
~CPruneVarSubMean | ( | ) | [virtual] |
Definition at line 27 of file PruneVarSubMean.cpp.
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 142 of file PruneVarSubMean.cpp.
apply preproc on single feature vector result in feature matrix
Implements CSimplePreProc< float64_t >.
Definition at line 178 of file PruneVarSubMean.cpp.
void cleanup | ( | ) | [virtual] |
cleanup
clean up allocated memory
Implements CPreProc.
Definition at line 129 of file PruneVarSubMean.cpp.
virtual const char* get_name | ( | void | ) | [virtual] |
bool init | ( | CFeatures * | f | ) | [virtual] |
initialize preprocessor from features
Implements CPreProc.
Definition at line 33 of file PruneVarSubMean.cpp.
bool divide_by_std [protected] |
divide by std
Definition at line 68 of file PruneVarSubMean.h.
int32_t* idx [protected] |
idx
Definition at line 60 of file PruneVarSubMean.h.
bool initialized [protected] |
true when already initialized
Definition at line 71 of file PruneVarSubMean.h.
mean
Definition at line 62 of file PruneVarSubMean.h.
int32_t num_idx [protected] |
num idx
Definition at line 66 of file PruneVarSubMean.h.
std
Definition at line 64 of file PruneVarSubMean.h.