GClasses
|
Principal Component Analysis. (Computes the principal components about the mean of the data when you call train. The transformed (reduced-dimensional) data will have a mean about the origin.) More...
#include <GTransform.h>
Public Member Functions | |
GPCA (size_t targetDims, GRand *pRand) | |
GPCA (GDomNode *pNode, GLearnerLoader &ll) | |
Load from a DOM. | |
virtual | ~GPCA () |
virtual GDomNode * | serialize (GDom *pDoc) |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. | |
void | computeEigVals () |
Specify to compute the eigenvalues during training. This method must be called before train is called. | |
void | aboutOrigin () |
Specify to compute the principal components about the origin (instead of computing them about the mean). | |
double * | eigVals () |
Returns the eigenvalues. Returns NULL if computeEigVals was not called. | |
size_t | targetDims () |
Returns the number of principal components that it will find. | |
double * | mean () |
Returns the mean of the data used to train this transform. | |
double * | basis (size_t i) |
Returns the i'th principal component vector. | |
GMatrix * | components () |
Returns a dataset where the first row is the centroid, and the remaining rows are the principal component vectors in order of decreasing eigenvalue. | |
virtual void | train (GMatrix &data) |
See the comment for GIncrementalTransform::train. | |
virtual void | transform (const double *pIn, double *pOut) |
See the comment for GIncrementalTransform::transform. Projects the specified point into fewer dimensions. | |
virtual void | untransform (const double *pIn, double *pOut) |
Computes a (lossy) high-dimensional point that corresponds with the specified low-dimensional coordinates. | |
virtual void | untransformToDistribution (const double *pIn, GPrediction *pOut) |
See the comment for GTwoWayIncrementalTransform::untransformToDistribution. | |
Protected Attributes | |
size_t | m_targetDims |
GMatrix * | m_pBasisVectors |
double * | m_pEigVals |
bool | m_aboutOrigin |
GRand * | m_pRand |
Principal Component Analysis. (Computes the principal components about the mean of the data when you call train. The transformed (reduced-dimensional) data will have a mean about the origin.)
GClasses::GPCA::GPCA | ( | size_t | targetDims, |
GRand * | pRand | ||
) |
GClasses::GPCA::GPCA | ( | GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) |
Load from a DOM.
virtual GClasses::GPCA::~GPCA | ( | ) | [virtual] |
void GClasses::GPCA::aboutOrigin | ( | ) | [inline] |
Specify to compute the principal components about the origin (instead of computing them about the mean).
double* GClasses::GPCA::basis | ( | size_t | i | ) | [inline] |
Returns the i'th principal component vector.
GMatrix* GClasses::GPCA::components | ( | ) | [inline] |
Returns a dataset where the first row is the centroid, and the remaining rows are the principal component vectors in order of decreasing eigenvalue.
void GClasses::GPCA::computeEigVals | ( | ) |
Specify to compute the eigenvalues during training. This method must be called before train is called.
double* GClasses::GPCA::eigVals | ( | ) | [inline] |
Returns the eigenvalues. Returns NULL if computeEigVals was not called.
double* GClasses::GPCA::mean | ( | ) | [inline] |
Returns the mean of the data used to train this transform.
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
Implements GClasses::GIncrementalTransform.
size_t GClasses::GPCA::targetDims | ( | ) | [inline] |
Returns the number of principal components that it will find.
virtual void GClasses::GPCA::train | ( | GMatrix & | data | ) | [virtual] |
See the comment for GIncrementalTransform::train.
Implements GClasses::GIncrementalTransform.
virtual void GClasses::GPCA::transform | ( | const double * | pIn, |
double * | pOut | ||
) | [virtual] |
See the comment for GIncrementalTransform::transform. Projects the specified point into fewer dimensions.
Implements GClasses::GIncrementalTransform.
virtual void GClasses::GPCA::untransform | ( | const double * | pIn, |
double * | pOut | ||
) | [virtual] |
Computes a (lossy) high-dimensional point that corresponds with the specified low-dimensional coordinates.
Implements GClasses::GTwoWayIncrementalTransform.
virtual void GClasses::GPCA::untransformToDistribution | ( | const double * | pIn, |
GPrediction * | pOut | ||
) | [virtual] |
See the comment for GTwoWayIncrementalTransform::untransformToDistribution.
Implements GClasses::GTwoWayIncrementalTransform.
bool GClasses::GPCA::m_aboutOrigin [protected] |
GMatrix* GClasses::GPCA::m_pBasisVectors [protected] |
double* GClasses::GPCA::m_pEigVals [protected] |
GRand* GClasses::GPCA::m_pRand [protected] |
size_t GClasses::GPCA::m_targetDims [protected] |