|
latest version v1.9 - last update 24 Nov 2005 |
|
#include <ltiPCA.h>
Inheritance diagram for lti::principalComponents< T >:


Public Member Functions | |
| principalComponents (const bool createDefaultParams=true) | |
| principalComponents (const parameters &par) | |
| principalComponents (const principalComponents &other) | |
| virtual | ~principalComponents () |
| virtual const char * | getTypeName () const |
| virtual bool | apply (const matrix< T > &data, matrix< T > &result) |
| virtual bool | apply (matrix< T > &srcdest) |
| virtual bool | apply (const vector< T > &src, vector< T > &result) |
| bool | setCovarianceAndMean (const matrix< T > &coVar, const vector< T > &meanVec) |
| virtual bool | transform (const vector< T > &src, vector< T > &result) const |
| virtual bool | transform (const matrix< T > &src, matrix< T > &result) const |
| virtual bool | transform (matrix< T > &srcdest) const |
| virtual bool | computeTransformMatrix (const matrix< T > &src) |
| virtual bool | train (const matrix< T > &src) |
| virtual bool | reconstruct (const vector< T > &coeff, vector< T > &dest) const |
| virtual bool | reconstruct (const matrix< T > &coeff, matrix< T > &dest) const |
| virtual bool | getTransformMatrix (matrix< T > &result) const |
| virtual const matrix< T > & | getTransformMatrix () const |
| virtual bool | getOffsetVector (vector< T > &result) const |
| virtual const vector< T > & | getOffsetVector () const |
| virtual bool | getEigenValues (vector< T > &result) const |
| virtual const vector< T > & | getEigenValues () const |
| virtual bool | getEigenVectors (matrix< T > &result) const |
| virtual bool | getEigenVectorsInRows (matrix< T > &result) const |
| virtual const matrix< T > & | getEigenVectors () const |
| virtual void | setDimension (int k) |
| principalComponents & | copy (const principalComponents &other) |
| principalComponents & | operator= (const principalComponents &other) |
| virtual functor * | clone () const |
| const parameters & | getParameters () const |
| virtual bool | updateParameters () |
| virtual bool | read (ioHandler &handler, const bool complete=true) |
| virtual bool | write (ioHandler &handler, const bool complete=true) const |
| int | getUsedDimension () const |
Protected Member Functions | |
| int | checkDim () |
| void | reset () |
Protected Attributes | |
| int | usedDimensionality |
Classes | |
| class | parameters |
| the parameters for the class principalComponents More... | |
It receives a set of input vectors in form of a matrix (each row of the matrix corresponds to an input vector), which will be transformed with PCA.
The first time you use the apply()-method, the transformation matrix will be computed. You can use this transformation matrix with other data sets using the transform() methods.
Please note that the eigenvector matrices will contain the eigenvector in the COLUMNS and not in the rows, as could be expected. This avoids the requirement of transposing matrices in the vector transformations (see also lti::eigenSystem<T>).
For large data matrices is is advisable to use singular value decomposition instead of an eigensystem for the PCA. The operation will usually be faster and using less memory. To do so set parameters::useSVD to true and set parameters::svd to singularValueDecomp<T> or one of its subclasses (eg. fastSVD<T> if you are using LAPACK)
|
||||||||||
|
default constructor
|
|
||||||||||
|
default constructor with parameters
|
|
||||||||||
|
copy constructor
|
|
|||||||||
|
destructor
|
|
||||||||||||||||
|
Transforms a single vector according to a previously computed transformation matrix. (this is an alias for the transform() method) |
|
||||||||||
|
On-Place version of the transformation. If you don't need to transform the input data, and just want to use the input matrix to compute the principal components you can use the method computeTransformMatrix(). If you just need to transform the data, without computing the transformation matrix, you can use the method transform().
|
|
||||||||||||||||
|
Computes the principal components of the data matrix and transforms it according to the new coordinate system. The result is the transformed matrix. Data and result must not be references to the same matrix. Data points are expected to be in the rows of the data matrix. This method uses the eigenvector functor given in the parameters. By default, it uses ltilib's own jacobi functor. However, you can speed it up considerably by using the eigensystem functor in the lamath directory. If you don't need to transform the input data, and just want to use the input matrix to compute the principal components you can use the method computeTransformMatrix(). If you just need to transform the data, without computing the transformation matrix, you can use the method transform().
|
|
|||||||||
|
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 Reimplemented in lti::regularizedPCA< T >. |
|
|||||||||
|
returns a pointer to a clone of this functor.
Implements lti::functor. Reimplemented in lti::regularizedPCA< T >. |
|
||||||||||
|
Compute the transformation matrix. Similar to the apply() method, but it does not transform the given data (this saves some time).
|
|
||||||||||
|
copy data of "other" functor.
|
|
|||||||||
|
Returns the previously computed eigenvalues of the covariance matrix.
|
|
||||||||||
|
Returns the previously computed eigenvalues of the covariance matrix.
|
|
|||||||||
|
Returns the previously computed eigenvectors of the covariance matrix.
|
|
||||||||||
|
Returns the previously computed eigenvectors of the covariance matrix.
|
|
||||||||||
|
Returns the previously computed eigenvectors of the covariance 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.
|
|
|||||||||
|
Returns the previously computed offset vector, which corresponds to the mean of the data.
|
|
||||||||||
|
Returns the previously computed offset vector, which corresponds to the mean of the data.
|
|
|||||||||
|
returns used parameters
Reimplemented from lti::functor. Reimplemented in lti::regularizedPCA< T >. |
|
|||||||||
|
Returns the previously computed transform matrix.
|
|
||||||||||
|
Returns the previously computed transform matrix.
|
|
|||||||||
|
returns the name of this type ("principalComponents")
Reimplemented from lti::linearAlgebraFunctor. |
|
|||||||||
|
Number of dimensions considered in the transformation.
|
|
||||||||||
|
Alias for copy.
|
|
||||||||||||||||
|
Reads this functor from the given handler.
Reimplemented from lti::functor. |
|
||||||||||||||||
|
Reconstructs a set of data vectors
As usual
|
|
||||||||||||||||
|
Reconstructs a data vector
|
|
|||||||||
|
Resets all private members to size 0. Used when an error occurs in the calculation of the transform matrix. |
|
||||||||||||||||
|
Pass the covariance matrix and the mean values directly to the functor to generate the transform matrix. If you know the mean and covariance of your data, you can use this method to speed up the computations of the transformation matrix. Otherwise, just call one of the apply() methods with your data vectors in the rows of the matrix. The covariance and mean vectors will be computed there automatically. |
|
||||||||||
|
Set the dimension to which the vectors should be reduced. This is just considered when computing the transformation matrix. After this matrix is determined the (destination) dimension is fixed and just can be changed by recalculating the transformation matrix. |
|
||||||||||
|
Alias for computeTransformMatrix().
|
|
||||||||||
|
Transform an entire matrix according to a previously computed transformation matrix. Unfortunately, we must choose a name different from apply.
|
|
||||||||||||||||
|
Transform an entire matrix according to a previously computed transformation matrix. Unfortunately, we must choose a name different from apply.
|
|
||||||||||||||||
|
Transforms a single vector according to a previously computed transformation matrix.
|
|
|||||||||
|
Update functor's parameters. This member initializes some internal data according to the values in the parameters.
Reimplemented from lti::functor. |
|
||||||||||||||||
|
Writes this functor to the given handler.
Reimplemented from lti::functor. |
|
|||||
|
dimensionality being used.
|