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 31 of file LogPlusOne.h.
Public Member Functions | |
CLogPlusOne () | |
virtual | ~CLogPlusOne () |
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 bool | load (FILE *f) |
initialize preprocessor from file | |
virtual bool | save (FILE *f) |
save preprocessor init-data to file | |
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 () |
CLogPlusOne::CLogPlusOne | ( | ) |
default constructor
Definition at line 17 of file LogPlusOne.cpp.
CLogPlusOne::~CLogPlusOne | ( | ) | [virtual] |
Definition at line 23 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 CSimplePreProc< float64_t >.
Definition at line 56 of file LogPlusOne.cpp.
apply preproc on single feature vector result in feature matrix
Implements CSimplePreProc< float64_t >.
Definition at line 75 of file LogPlusOne.cpp.
void CLogPlusOne::cleanup | ( | ) | [virtual] |
cleanup
clean up allocated memory
Implements CPreProc.
Definition at line 37 of file LogPlusOne.cpp.
virtual const char* CLogPlusOne::get_name | ( | ) | [virtual] |
Definition at line 62 of file LogPlusOne.h.
bool CLogPlusOne::init | ( | CFeatures * | f | ) | [virtual] |
initialize preprocessor from features
Implements CPreProc.
Definition at line 28 of file LogPlusOne.cpp.
bool CLogPlusOne::load | ( | FILE * | f | ) | [virtual] |
initialize preprocessor from file
Definition at line 42 of file LogPlusOne.cpp.
bool CLogPlusOne::load_init_data | ( | FILE * | src | ) | [virtual] |
initialize preprocessor from file
Implements CPreProc.
Definition at line 87 of file LogPlusOne.cpp.
bool CLogPlusOne::save | ( | FILE * | f | ) | [virtual] |
save preprocessor init-data to file
Definition at line 48 of file LogPlusOne.cpp.
bool CLogPlusOne::save_init_data | ( | FILE * | dst | ) | [virtual] |
save init-data (like transforamtion matrices etc) to file
Implements CPreProc.
Definition at line 93 of file LogPlusOne.cpp.