GClasses

GClasses::GDiscretize Class Reference

This transform uses buckets to convert continuous data into discrete data. It is common to use GFilter to combine this with your favorite modeler (which only supports discrete values) to create a modeler that can also support continuous values as well. More...

#include <GTransform.h>

Inheritance diagram for GClasses::GDiscretize:
GClasses::GTwoWayIncrementalTransform GClasses::GIncrementalTransform GClasses::GTransform

List of all members.

Public Member Functions

 GDiscretize (size_t buckets=(size_t)-1)
 if buckets is less than 0, then it will use the floor of the square root of the number of rows in the data
 GDiscretize (GDomNode *pNode, GLearnerLoader &ll)
 Load from a DOM.
virtual ~GDiscretize ()
virtual GDomNodeserialize (GDom *pDoc)
 Marshal this object into a DOM, which can then be converted to a variety of serial formats.
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.
virtual void untransform (const double *pIn, double *pOut)
 See the comment for GTwoWayIncrementalTransform::untransform.
virtual void untransformToDistribution (const double *pIn, GPrediction *pOut)
 See the comment for GTwoWayIncrementalTransform::untransformToDistribution.

Protected Attributes

size_t m_bucketsIn
size_t m_bucketsOut
double * m_pMins
double * m_pRanges

Detailed Description

This transform uses buckets to convert continuous data into discrete data. It is common to use GFilter to combine this with your favorite modeler (which only supports discrete values) to create a modeler that can also support continuous values as well.


Constructor & Destructor Documentation

GClasses::GDiscretize::GDiscretize ( size_t  buckets = (size_t)-1)

if buckets is less than 0, then it will use the floor of the square root of the number of rows in the data

GClasses::GDiscretize::GDiscretize ( GDomNode pNode,
GLearnerLoader ll 
)

Load from a DOM.

virtual GClasses::GDiscretize::~GDiscretize ( ) [virtual]

Member Function Documentation

virtual GDomNode* GClasses::GDiscretize::serialize ( GDom pDoc) [virtual]

Marshal this object into a DOM, which can then be converted to a variety of serial formats.

Implements GClasses::GIncrementalTransform.

virtual void GClasses::GDiscretize::train ( GMatrix data) [virtual]
virtual void GClasses::GDiscretize::transform ( const double *  pIn,
double *  pOut 
) [virtual]
virtual void GClasses::GDiscretize::untransform ( const double *  pIn,
double *  pOut 
) [virtual]
virtual void GClasses::GDiscretize::untransformToDistribution ( const double *  pIn,
GPrediction pOut 
) [virtual]

Member Data Documentation

double* GClasses::GDiscretize::m_pMins [protected]
double* GClasses::GDiscretize::m_pRanges [protected]