Linear Discriminant Analysis (LDA). More...
#include <LDA.h>
Public Member Functions | |
| LDA () | |
| Constructor. | |
| ~LDA () | |
| Destructor. | |
| void | init (Model &model) |
| The initialization checks for compatibility of the model. | |
| double | optimize (Model &model, ErrorFunction &error, const Array< double > &input, const Array< double > &target) |
| The inherited optimize function inherits one of the specialized versions for LinearClassifier or AffineLinearFunction models. | |
| double | optimize (LinearClassifier &model, const Array< double > &input, const Array< double > &target) |
| Compute the LDA solution for a multi-class problem. | |
| double | optimize (AffineLinearFunction &model, const Array< double > &input, const Array< double > &target) |
| Compute the LDA solution for a binary classification problem with is stated as a zero-thresholded affine linear function. | |
Linear Discriminant Analysis (LDA).
Definition at line 63 of file LDA.h.
| void LDA::init | ( | Model & | model | ) | [virtual] |
The initialization checks for compatibility of the model.
It must be either a LinearClassifier or a AffineLinearFunction in case of binary classification.
Implements Optimizer.
| double LDA::optimize | ( | AffineLinearFunction & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) |
Compute the LDA solution for a binary classification problem with is stated as a zero-thresholded affine linear function.
In this case the targets must be one-dimensional, taking the values +1 and -1.
Definition at line 154 of file LDA.cpp.
References Model::getInputDimension(), i, and Model::setParameter().
| double LDA::optimize | ( | LinearClassifier & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) |
Compute the LDA solution for a multi-class problem.
Let c be the number of classes. Then the targets are assumes to be vectors in
padded with zeros and a single one in the component corresponding to the target class.
Definition at line 78 of file LDA.cpp.
References Model::getInputDimension(), LinearClassifier::getNumberOfClasses(), i, and LinearClassifier::setParameter().
| double LDA::optimize | ( | Model & | model, | |
| ErrorFunction & | error, | |||
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) | [virtual] |
The inherited optimize function inherits one of the specialized versions for LinearClassifier or AffineLinearFunction models.
ATTENTION: The target data must be organized differently for these models!
Implements Optimizer.