Preprocessor LogPlusOne does what the name says, it adds one to a dense real valued vector and takes the logarithm of each component of it.
It therefore does not need any initialization. It is most useful in situations where the inputs are counts: When one compares differences of small counts any difference may matter a lot, while small differences in large counts don't. This is what this log transformation controls for.
Definition at line 33 of file LogPlusOne.h.
Public Member Functions | |
CLogPlusOne () | |
virtual | ~CLogPlusOne () |
virtual bool | init (CFeatures *features) |
initialize preprocessor from features | |
virtual void | cleanup () |
cleanup | |
virtual bool | load (FILE *f) |
initialize preprocessor from file | |
virtual bool | save (FILE *f) |
save preprocessor init-data to file | |
virtual SGMatrix< float64_t > | apply_to_feature_matrix (CFeatures *features) |
virtual SGVector< float64_t > | apply_to_feature_vector (SGVector< float64_t > vector) |
virtual const char * | get_name () const |
virtual EPreprocessorType | get_type () const |
return a type of preprocessor |
CLogPlusOne | ( | ) |
default constructor
Definition at line 19 of file LogPlusOne.cpp.
~CLogPlusOne | ( | ) | [virtual] |
destructor
Definition at line 25 of file LogPlusOne.cpp.
apply preproc on feature matrix result in feature matrix return pointer to feature_matrix, i.e. f->get_feature_matrix();
Implements CSimplePreprocessor< float64_t >.
Definition at line 62 of file LogPlusOne.cpp.
apply preproc on single feature vector result in feature matrix
Implements CSimplePreprocessor< float64_t >.
Definition at line 78 of file LogPlusOne.cpp.
void cleanup | ( | ) | [virtual] |
cleanup
clean up allocated memory
Implements CPreprocessor.
Definition at line 39 of file LogPlusOne.cpp.
virtual const char* get_name | ( | void | ) | const [virtual] |
virtual EPreprocessorType get_type | ( | ) | const [virtual] |
return a type of preprocessor
Reimplemented from CSimplePreprocessor< float64_t >.
Definition at line 65 of file LogPlusOne.h.
bool init | ( | CFeatures * | features | ) | [virtual] |
initialize preprocessor from features
Implements CPreprocessor.
Definition at line 30 of file LogPlusOne.cpp.
bool load | ( | FILE * | f | ) | [virtual] |
initialize preprocessor from file
Definition at line 44 of file LogPlusOne.cpp.
bool save | ( | FILE * | f | ) | [virtual] |
save preprocessor init-data to file
Definition at line 52 of file LogPlusOne.cpp.