GClasses

GClasses::GIncrementalTransform Class Reference

This is the base class of algorithms that can transform data one row at a time without supervision. More...

#include <GTransform.h>

Inheritance diagram for GClasses::GIncrementalTransform:
GClasses::GTransform GClasses::GAttributeSelector GClasses::GNoiseGenerator GClasses::GPairProduct GClasses::GSelfOrganizingMap GClasses::GTwoWayIncrementalTransform GClasses::GDiscretize GClasses::GImputeMissingVals GClasses::GNominalToCat GClasses::GNormalize GClasses::GPCA GClasses::GTwoWayTransformChainer

List of all members.

Public Member Functions

 GIncrementalTransform ()
 GIncrementalTransform (GDomNode *pNode, GLearnerLoader &ll)
virtual ~GIncrementalTransform ()
virtual GDomNodeserialize (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_relationbefore ()
 Returns a relation object describing the data before it is transformed.
sp_relationafter ()
 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 GMatrixdoit (GMatrix &in)
 This calls Train with in, then transforms in and returns the results. The caller is responsible for deleting the new matrix.
virtual GMatrixtransformBatch (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

Detailed Description

This is the base class of algorithms that can transform data one row at a time without supervision.


Constructor & Destructor Documentation

GClasses::GIncrementalTransform::GIncrementalTransform ( ) [inline]
GClasses::GIncrementalTransform::GIncrementalTransform ( GDomNode pNode,
GLearnerLoader ll 
) [inline]
virtual GClasses::GIncrementalTransform::~GIncrementalTransform ( ) [virtual]

Member Function Documentation

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

virtual GMatrix* GClasses::GIncrementalTransform::doit ( GMatrix in) [virtual]

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.

virtual GDomNode* GClasses::GIncrementalTransform::serialize ( GDom pDoc) [pure virtual]
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.

virtual GMatrix* GClasses::GIncrementalTransform::transformBatch ( GMatrix in) [virtual]

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.


Member Data Documentation