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.
公有成员 | |
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 (CFeatures *data=NULL) |
virtual EClassifierType | get_classifier_type () |
virtual void | set_features (CDotFeatures *feat) |
virtual const char * | get_name () const |
保护属性 | |
float64_t | m_gamma |
CLDA | ( | float64_t | gamma, | |
CSimpleFeatures< float64_t > * | traindat, | |||
CLabels * | trainlab | |||
) |
virtual EClassifierType get_classifier_type | ( | ) | [virtual] |
virtual void set_features | ( | CDotFeatures * | feat | ) | [virtual] |
bool train | ( | CFeatures * | data = NULL |
) | [virtual] |
train LDA classifier
data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) |
重载CClassifier。