Class LDA implements regularized Linear Discriminant Analysis.
LDA learns a linear classifier and requires examples to be CSimpleFeatures. The learned linear classification rule is optimal under the assumption that both classes a gaussian distributed with equal co-variance. To find a linear separation in training, the in-between class variance is maximized and the within class variance is minimized, i.e.
is maximized, where
is the between class scatter matrix and
is the within class scatter matrix with mean and
the set of examples of class c.
LDA is very fast for low-dimensional samples. The regularization parameter (especially useful in the low sample case) should be tuned in cross-validation.
Definition at line 49 of file LDA.h.
Public Member Functions | |
CLDA (float64_t gamma=0) | |
CLDA (float64_t gamma, CSimpleFeatures< float64_t > *traindat, CLabels *trainlab) | |
virtual | ~CLDA () |
void | set_gamma (float64_t gamma) |
float64_t | get_gamma () |
virtual bool | train () |
virtual EClassifierType | get_classifier_type () |
virtual void | set_features (CDotFeatures *feat) |
virtual const char * | get_name () const |
Protected Attributes | |
float64_t | m_gamma |
CLDA::CLDA | ( | float64_t | gamma = 0 |
) |
CLDA::CLDA | ( | float64_t | gamma, | |
CSimpleFeatures< float64_t > * | traindat, | |||
CLabels * | trainlab | |||
) |
virtual EClassifierType CLDA::get_classifier_type | ( | ) | [virtual] |
virtual const char* CLDA::get_name | ( | ) | const [virtual] |
virtual void CLDA::set_features | ( | CDotFeatures * | feat | ) | [virtual] |
void CLDA::set_gamma | ( | float64_t | gamma | ) |
bool CLDA::train | ( | ) | [virtual] |
float64_t CLDA::m_gamma [protected] |