GClasses
|
This is the base class of algorithms that can transform data one row at a time without supervision. More...
#include <GTransform.h>
Public Member Functions | |
GIncrementalTransform () | |
GIncrementalTransform (GDomNode *pNode, GLearnerLoader &ll) | |
virtual | ~GIncrementalTransform () |
virtual GDomNode * | serialize (GDom *pDoc)=0 |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. | |
virtual void | train (GMatrix &data)=0 |
Trains the transform on the data in pData. | |
sp_relation & | before () |
Returns a relation object describing the data before it is transformed. | |
sp_relation & | after () |
Returns a relation object describing the data after it is transformed. | |
virtual void | transform (const double *pIn, double *pOut)=0 |
pIn is the source row. pOut is a buffer that will hold the transformed row. train must be called before this method is used | |
virtual GMatrix * | doit (GMatrix &in) |
This calls Train with in, then transforms in and returns the results. The caller is responsible for deleting the new matrix. | |
virtual GMatrix * | transformBatch (GMatrix &in) |
This assumes that train has already been called, and transforms all the rows in in returning the resulting matrix. The caller is responsible for deleting the new matrix. | |
double * | innerBuf () |
Returns a buffer of sufficient size to store an inner (transformed) vector. The caller does not have to delete the buffer, but the same buffer will be returned each time. | |
Protected Attributes | |
sp_relation | m_pRelationBefore |
sp_relation | m_pRelationAfter |
double * | m_pInnerBuf |
This is the base class of algorithms that can transform data one row at a time without supervision.
GClasses::GIncrementalTransform::GIncrementalTransform | ( | ) | [inline] |
GClasses::GIncrementalTransform::GIncrementalTransform | ( | GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) | [inline] |
virtual GClasses::GIncrementalTransform::~GIncrementalTransform | ( | ) | [virtual] |
sp_relation& GClasses::GIncrementalTransform::after | ( | ) | [inline] |
Returns a relation object describing the data after it is transformed.
train must be called before this method is used
sp_relation& GClasses::GIncrementalTransform::before | ( | ) | [inline] |
Returns a relation object describing the data before it is transformed.
train must be called before this method is used
This calls Train with in, then transforms in and returns the results. The caller is responsible for deleting the new matrix.
Implements GClasses::GTransform.
Reimplemented in GClasses::GSelfOrganizingMap.
double* GClasses::GIncrementalTransform::innerBuf | ( | ) |
Returns a buffer of sufficient size to store an inner (transformed) vector. The caller does not have to delete the buffer, but the same buffer will be returned each time.
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
Implemented in GClasses::GSelfOrganizingMap, GClasses::GTwoWayTransformChainer, GClasses::GPCA, GClasses::GNoiseGenerator, GClasses::GPairProduct, GClasses::GAttributeSelector, GClasses::GNominalToCat, GClasses::GNormalize, GClasses::GDiscretize, and GClasses::GImputeMissingVals.
virtual void GClasses::GIncrementalTransform::train | ( | GMatrix & | data | ) | [pure virtual] |
Trains the transform on the data in pData.
For those implementing subclasses, must set m_pRelationBefore and m_pRelationAfter
Implemented in GClasses::GSelfOrganizingMap, GClasses::GTwoWayTransformChainer, GClasses::GPCA, GClasses::GNoiseGenerator, GClasses::GPairProduct, GClasses::GAttributeSelector, GClasses::GNominalToCat, GClasses::GNormalize, GClasses::GDiscretize, and GClasses::GImputeMissingVals.
virtual void GClasses::GIncrementalTransform::transform | ( | const double * | pIn, |
double * | pOut | ||
) | [pure virtual] |
pIn is the source row. pOut is a buffer that will hold the transformed row. train must be called before this method is used
Implemented in GClasses::GSelfOrganizingMap, GClasses::GTwoWayTransformChainer, GClasses::GPCA, GClasses::GNoiseGenerator, GClasses::GPairProduct, GClasses::GAttributeSelector, GClasses::GNominalToCat, GClasses::GNormalize, GClasses::GDiscretize, and GClasses::GImputeMissingVals.
This assumes that train has already been called, and transforms all the rows in in returning the resulting matrix. The caller is responsible for deleting the new matrix.
Reimplemented in GClasses::GImputeMissingVals.
double* GClasses::GIncrementalTransform::m_pInnerBuf [protected] |