GClasses

GClasses::GPolynomial Class Reference

This regresses a multi-dimensional polynomial to fit the data. More...

#include <GPolynomial.h>

Inheritance diagram for GClasses::GPolynomial:
GClasses::GSupervisedLearner GClasses::GTransducer

List of all members.

Public Member Functions

 GPolynomial (GRand &rand)
 It will have the same number of control points in every feature dimension.
 GPolynomial (GDomNode *pNode, GLearnerLoader &ll)
 Load from a DOM.
virtual ~GPolynomial ()
void setControlPoints (size_t n)
 Set the number of control points in the Bezier representation of the polynomial (which is one more than the polynomial order). The default is 3.
size_t controlPoints ()
 Returns the number of control points.
void autoTune (GMatrix &features, GMatrix &labels)
 Uses cross-validation to find a set of parameters that works well with the provided data.
virtual GDomNodeserialize (GDom *pDoc)
 Marshal this object into a DOM, which can then be converted to a variety of serial formats.
virtual void clear ()
 See the comment for GSupervisedLearner::clear.

Static Public Member Functions

static void test ()
 Performs unit tests for this class. Throws an exception if there is a failure.

Protected Member Functions

virtual void trainInner (GMatrix &features, GMatrix &labels)
 See the comment for GSupervisedLearner::trainInner.
virtual void predictInner (const double *pIn, double *pOut)
 See the comment for GSupervisedLearner::predictInner.
virtual void predictDistributionInner (const double *pIn, GPrediction *pOut)
 See the comment for GSupervisedLearner::predictDistributionInner.
virtual bool canImplicitlyHandleNominalFeatures ()
 See the comment for GTransducer::canImplicitlyHandleNominalFeatures.
virtual bool canImplicitlyHandleNominalLabels ()
 See the comment for GTransducer::canImplicitlyHandleNominalLabels.

Protected Attributes

size_t m_controlPoints
std::vector
< GPolynomialSingleLabel * > 
m_polys

Detailed Description

This regresses a multi-dimensional polynomial to fit the data.


Constructor & Destructor Documentation

GClasses::GPolynomial::GPolynomial ( GRand rand)

It will have the same number of control points in every feature dimension.

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

Load from a DOM.

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

Member Function Documentation

void GClasses::GPolynomial::autoTune ( GMatrix features,
GMatrix labels 
)

Uses cross-validation to find a set of parameters that works well with the provided data.

virtual bool GClasses::GPolynomial::canImplicitlyHandleNominalFeatures ( ) [inline, protected, virtual]
virtual bool GClasses::GPolynomial::canImplicitlyHandleNominalLabels ( ) [inline, protected, virtual]

See the comment for GTransducer::canImplicitlyHandleNominalLabels.

Reimplemented from GClasses::GTransducer.

virtual void GClasses::GPolynomial::clear ( ) [virtual]

See the comment for GSupervisedLearner::clear.

Implements GClasses::GSupervisedLearner.

size_t GClasses::GPolynomial::controlPoints ( )

Returns the number of control points.

virtual void GClasses::GPolynomial::predictDistributionInner ( const double *  pIn,
GPrediction pOut 
) [protected, virtual]
virtual void GClasses::GPolynomial::predictInner ( const double *  pIn,
double *  pOut 
) [protected, virtual]
virtual GDomNode* GClasses::GPolynomial::serialize ( GDom pDoc) [virtual]

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

Implements GClasses::GSupervisedLearner.

void GClasses::GPolynomial::setControlPoints ( size_t  n)

Set the number of control points in the Bezier representation of the polynomial (which is one more than the polynomial order). The default is 3.

static void GClasses::GPolynomial::test ( ) [static]

Performs unit tests for this class. Throws an exception if there is a failure.

Reimplemented from GClasses::GSupervisedLearner.

virtual void GClasses::GPolynomial::trainInner ( GMatrix features,
GMatrix labels 
) [protected, virtual]

Member Data Documentation

std::vector<GPolynomialSingleLabel*> GClasses::GPolynomial::m_polys [protected]