GClasses
|
This class augments data. That is, it transforms the data according to some provided transformation, and attaches the transformed data as new attributes to the existing data.
#include <GTransform.h>
Public Member Functions | |
GDataAugmenter (GIncrementalTransform *pTransform) | |
Generic constructor. pTransform specifies any data transformation. The transformed data will be attached to the existing data in order to augment it. This method takes ownership of pTransform. More... | |
GDataAugmenter (const GDomNode *pNode, GLearnerLoader &ll) | |
Load from a DOM. More... | |
virtual | ~GDataAugmenter () |
virtual GDomNode * | serialize (GDom *pDoc) const |
Marshal this object into a DOM, which can then be converted to a variety of serial formats. More... | |
virtual void | transform (const GVec &in, GVec &out) |
See the comment for GIncrementalTransform::transform. More... | |
virtual void | untransform (const GVec &in, GVec &out) |
See the comment for GIncrementalTransform::untransform. More... | |
virtual void | untransformToDistribution (const GVec &in, GPrediction *pOut) |
Throws an exception. More... | |
Public Member Functions inherited from GClasses::GIncrementalTransform | |
GIncrementalTransform () | |
GIncrementalTransform (const GDomNode *pNode) | |
virtual | ~GIncrementalTransform () |
const GRelation & | after () const |
Returns a relation object describing the data after it is transformed. More... | |
const GRelation & | before () const |
Returns a relation object describing the data before it is transformed. More... | |
GVec & | innerBuf () |
Returns a buffer of sufficient size to store an inner (transformed) vector. The caller should not to delete the buffer. The same buffer will be returned each time. More... | |
virtual GMatrix * | reduce (const GMatrix &in) |
This calls train, then calls transformBatch, and returns the result. More... | |
void | setAfter (GRelation *pRel) |
Sets the after relation. Takes ownership of pRel. More... | |
void | setBefore (GRelation *pRel) |
Sets the before relation. Takes ownership of pRel. More... | |
void | train (const GMatrix &data) |
Trains the transform on the data in pData. (This method may be a no-op for transformations that always behave in the same manner.) More... | |
void | train (const GRelation &pRelation) |
"Trains" the transform without any data. More... | |
virtual GMatrix * | transformBatch (const 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. More... | |
virtual std::unique_ptr< GMatrix > | untransformBatch (const GMatrix &in) |
This assumes train was previously called, and untransforms all the rows in pIn and returns the results. More... | |
Public Member Functions inherited from GClasses::GTransform | |
GTransform () | |
GTransform (const GDomNode *pNode) | |
virtual | ~GTransform () |
Protected Member Functions | |
virtual GRelation * | trainInner (const GMatrix &data) |
See the comment for GIncrementalTransform::train. More... | |
virtual GRelation * | trainInner (const GRelation &relation) |
See the comment for GIncrementalTransform::train. More... | |
Protected Member Functions inherited from GClasses::GIncrementalTransform | |
virtual GDomNode * | baseDomNode (GDom *pDoc, const char *szClassName) const |
Child classes should use this in their implementation of serialize. More... | |
Protected Attributes | |
GIncrementalTransform * | m_pTransform |
Additional Inherited Members | |
Static Public Member Functions inherited from GClasses::GIncrementalTransform | |
static void | test () |
Performs unit tests for this class. Throws an exception if there is a failure. More... | |
GClasses::GDataAugmenter::GDataAugmenter | ( | GIncrementalTransform * | pTransform | ) |
Generic constructor. pTransform specifies any data transformation. The transformed data will be attached to the existing data in order to augment it. This method takes ownership of pTransform.
GClasses::GDataAugmenter::GDataAugmenter | ( | const GDomNode * | pNode, |
GLearnerLoader & | ll | ||
) |
Load from a DOM.
|
virtual |
Marshal this object into a DOM, which can then be converted to a variety of serial formats.
Implements GClasses::GIncrementalTransform.
See the comment for GIncrementalTransform::train.
Implements GClasses::GIncrementalTransform.
|
protectedvirtual |
See the comment for GIncrementalTransform::train.
Implements GClasses::GIncrementalTransform.
See the comment for GIncrementalTransform::transform.
Implements GClasses::GIncrementalTransform.
See the comment for GIncrementalTransform::untransform.
Implements GClasses::GIncrementalTransform.
|
virtual |
Throws an exception.
Implements GClasses::GIncrementalTransform.
|
protected |