latest version v1.9 - last update 10 Apr 2010 |
Functor for iteratively computing a linear discriminant analysis. More...
#include <ltiSerialLDA.h>
Classes | |
class | parameters |
the parameters for the class serialLDA More... | |
Public Member Functions | |
serialLDA () | |
serialLDA (const serialLDA &other) | |
virtual | ~serialLDA () |
virtual const char * | getTypeName () const |
bool | consider (const matrix< T > &src) |
bool | apply (const matrix< T > &src, matrix< T > &result) |
bool | apply (const vector< T > &src, vector< T > &result) |
bool | apply (matrix< T > &srcdest) |
void | setDimension (int k) |
bool | getEigenValues (vector< T > &result) const |
const vector< T > & | getEigenValues () const |
bool | getEigenVectors (matrix< T > &result) const |
bool | getEigenVectorsInRows (matrix< T > &result) const |
serialLDA & | copy (const serialLDA &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
bool | read (ioHandler &handler, const bool complete=true) |
bool | write (ioHandler &handler, const bool complete=true) const |
Protected Member Functions | |
int | checkDim () |
Functor for iteratively computing a linear discriminant analysis.
The functor is used by subsequent calls of consider(), which is given the data of another class each time. Then, the first time apply() is called, the LDA is computed and can be used. It is possible to mix calls to consider and apply.
It uses functors that require the LAPack.
lti::serialLDA< T >::serialLDA | ( | ) |
default constructor
lti::serialLDA< T >::serialLDA | ( | const serialLDA< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::serialLDA< T >::~serialLDA | ( | ) | [virtual] |
destructor
bool lti::serialLDA< T >::apply | ( | matrix< T > & | srcdest | ) |
On-Place version of the transformation.
srcdest | matrix<T> with the source data, which will also contain the result. |
bool lti::serialLDA< T >::apply | ( | const vector< T > & | src, | |
vector< T > & | result | |||
) |
Uses a previously computed transform in order to reduce the given data set's dimensionality according to the resultDim parameter.
src | matrix<T> with the source data. | |
result | matrix<T> with the result data. |
bool lti::serialLDA< T >::apply | ( | const matrix< T > & | src, | |
matrix< T > & | result | |||
) |
Uses a previously computed transform in order to reduce the given data set's dimensionality according to the resultDim parameter.
src | matrix<T> with the source data. | |
result | matrix<T> with the result data. |
int lti::serialLDA< T >::checkDim | ( | ) | [protected] |
Determines the intrinsic dimensionality of the data set if the user specify autoDim, otherwise return parameters::resultDim.
The member usedDimensionality will be set with the returned value
virtual functor* lti::serialLDA< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
bool lti::serialLDA< T >::consider | ( | const matrix< T > & | src | ) |
Adds a single class to the lda.
This can be used as an iterative version of the apply method. Class labels are determined automatically.
src | matrix<T> with the source data. |
serialLDA& lti::serialLDA< T >::copy | ( | const serialLDA< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
const vector<T>& lti::serialLDA< T >::getEigenValues | ( | ) | const |
Returns the previously computed eigenvalues of the scatter matrix.
bool lti::serialLDA< T >::getEigenValues | ( | vector< T > & | result | ) | const |
bool lti::serialLDA< T >::getEigenVectors | ( | matrix< T > & | result | ) | const |
bool lti::serialLDA< T >::getEigenVectorsInRows | ( | matrix< T > & | result | ) | const |
Returns the previously computed eigenvectors of the scatter matrix.
This method will call the normal getEigenVectors() methods and after that will transpose the obtained matrix, i.e. it is faster to get the eigenvectors in the columns.
result | the matrix which will receive the eigenvectors. Each row of the matrix contains one eigenvector. |
const parameters& lti::serialLDA< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::serialLDA< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("serialLDA")
Reimplemented from lti::linearAlgebraFunctor.
bool lti::serialLDA< T >::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
Computes the between-class scatter matrix Sb.
Reimplemented from lti::functor.
void lti::serialLDA< T >::setDimension | ( | int | k | ) |
Set the dimension to which the vectors should be reduced.
bool lti::serialLDA< T >::write | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | const [virtual] |
return the last message set with setStatusString().
This will never return 0. If no status-string has been set yet an empty string (pointer to a string with only the char(0)) will be returned. set a status string.
msg | the const string to be reported next time by getStatusString(). The given string will be copied. This message will be usually set within the apply methods to indicate an error cause. |
Note that the change of the status string is not considered as a change in the functor status. append a message to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.
msg | message to be appended to the current status string. |
Note that the change of the status string is not considered as a change in the functor status. append an integer value to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.
msg | integer value to be appended to the current status string. |
Note that the change of the status string is not considered as a change in the functor status. append a double value to the current status string. Take care to reset the status string by calling setStatusString() for each call of an apply() or similar method. appendStatusString() should only be used after setStatusString() has been called.
msg | double value to be appended to the current status string. |
Note that the change of the status string is not considered as a change in the functor status. Append the status string of another functor to this functors status string. To achieve better readability of the resulting message a new line is started with the other functor's name and the message.
Note that the change of the status string is not considered as a change in the functor status. write the functor in the given ioHandler. The default implementation is to write just the parameters object.
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::functor.