SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions
CLogPlusOne Class Reference

Detailed Description

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.

\[ {\bf x}\leftarrow \log({\bf x}+{\bf 1}) \]

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.

Inheritance diagram for CLogPlusOne:
Inheritance graph
[legend]

Public Member Functions

 CLogPlusOne ()
 
virtual ~CLogPlusOne ()
 
virtual bool init (CFeatures *features)
 initialize preprocessor from features More...
 
virtual void cleanup ()
 cleanup More...
 
virtual bool load (FILE *f)
 initialize preprocessor from file More...
 
virtual bool save (FILE *f)
 save preprocessor init-data to file More...
 
virtual SGMatrix< float64_tapply_to_feature_matrix (CFeatures *features)
 
virtual SGVector< float64_tapply_to_feature_vector (SGVector< float64_t > vector)
 
virtual const char * get_name () const
 
virtual EPreprocessorType get_type () const
 return a type of preprocessor More...
 
- 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)
 
SGIOget_global_io ()
 
void set_global_parallel (Parallel *parallel)
 
Parallelget_global_parallel ()
 
void set_global_version (Version *version)
 
Versionget_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 ()
 

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
 
Parallelparallel
 
Versionversion
 
Parameterm_parameters
 
Parameterm_model_selection_parameters
 
- 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)
 

Constructor & Destructor Documentation

default constructor

Definition at line 19 of file LogPlusOne.cpp.

~CLogPlusOne ( )
virtual

destructor

Definition at line 25 of file LogPlusOne.cpp.

Member Function Documentation

SGMatrix< float64_t > apply_to_feature_matrix ( CFeatures features)
virtual

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.

SGVector< float64_t > apply_to_feature_vector ( SGVector< float64_t vector)
virtual

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 ( ) const
virtual
Returns
object name

Implements CSGObject.

Definition at line 62 of file LogPlusOne.h.

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.


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

SHOGUN Machine Learning Toolbox - Documentation