GClasses

GClasses::GBaselineLearner Class Reference

Always outputs the label mean (for continuous labels) and the most common class (for nominal labels). More...

#include <GLearner.h>

Inheritance diagram for GClasses::GBaselineLearner:
GClasses::GSupervisedLearner GClasses::GTransducer

List of all members.

Public Member Functions

 GBaselineLearner (GRand &rand)
 General-purpose constructor.
 GBaselineLearner (GDomNode *pNode, GLearnerLoader &ll)
 Deserialization constructor.
virtual ~GBaselineLearner ()
 Destructor.
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.
void autoTune (GMatrix &features, GMatrix &labels)
 This model has no parameters to tune, so this method is a noop.

Static Public Member Functions

static void test ()
 Runs some unit tests related to supervised learning. Throws an exception if any problems are found.

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.

Protected Attributes

std::vector< double > m_prediction

Detailed Description

Always outputs the label mean (for continuous labels) and the most common class (for nominal labels).


Constructor & Destructor Documentation

GClasses::GBaselineLearner::GBaselineLearner ( GRand rand)

General-purpose constructor.

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

Deserialization constructor.

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

Destructor.


Member Function Documentation

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

This model has no parameters to tune, so this method is a noop.

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

See the comment for GSupervisedLearner::clear.

Implements GClasses::GSupervisedLearner.

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

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

Implements GClasses::GSupervisedLearner.

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

Runs some unit tests related to supervised learning. Throws an exception if any problems are found.

Reimplemented from GClasses::GSupervisedLearner.

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

Member Data Documentation

std::vector<double> GClasses::GBaselineLearner::m_prediction [protected]