LDA Class Reference

Linear Discriminant Analysis (LDA). More...

#include <LDA.h>

Inheritance diagram for LDA:
Optimizer

List of all members.

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.

Detailed Description

Linear Discriminant Analysis (LDA).

This optimizer trains a linear model using linear discriminant analysis.

Definition at line 63 of file LDA.h.


Constructor & Destructor Documentation

LDA::LDA (  ) 

Constructor.

Definition at line 52 of file LDA.cpp.

LDA::~LDA (  ) 

Destructor.

Definition at line 56 of file LDA.cpp.


Member Function Documentation

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.

Definition at line 61 of file LDA.cpp.

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 $ R^c $ 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.

Definition at line 68 of file LDA.cpp.


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