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 52 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 EClassifierType | get_classifier_type () |
virtual void | set_features (CDotFeatures *feat) |
virtual const char * | get_name () const |
Protected Member Functions | |
virtual bool | train_machine (CFeatures *data=NULL) |
Protected Attributes | |
float64_t | m_gamma |
CLDA | ( | float64_t | gamma, | |
CSimpleFeatures< float64_t > * | traindat, | |||
CLabels * | trainlab | |||
) |
virtual EClassifierType get_classifier_type | ( | ) | [virtual] |
virtual const char* get_name | ( | void | ) | const [virtual] |
virtual void set_features | ( | CDotFeatures * | feat | ) | [virtual] |
void set_gamma | ( | float64_t | gamma | ) |
bool train_machine | ( | CFeatures * | data = NULL |
) | [protected, virtual] |