GClasses

GClasses::GInstanceTable Class Reference

This represents a grid of values. It might be useful as a Q-table with Q-learning. More...

#include <GKNN.h>

Inheritance diagram for GClasses::GInstanceTable:
GClasses::GIncrementalLearner GClasses::GSupervisedLearner GClasses::GTransducer

List of all members.

Public Member Functions

 GInstanceTable (size_t dims, size_t *pDims, GRand &rand)
 dims specifies the number of feature dimensions. pDims specifies the number of discrete zero-based values for each feature dim.
virtual ~GInstanceTable ()
virtual GDomNodeserialize (GDom *pDoc)
 Serialize this table.
virtual void trainSparse (GSparseMatrix &features, GMatrix &labels)
 See the comment for GIncrementalLearner::trainSparse.
virtual void clear ()
 Clears the internal model.

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 void beginIncrementalLearningInner (sp_relation &pFeatureRel, sp_relation &pLabelRel)
 See the comment for GIncrementalLearner::beginIncrementalLearningInner.
virtual void trainIncrementalInner (const double *pIn, const double *pOut)
 See the comment for GIncrementalLearner::trainIncrementalInner.

Protected Attributes

size_t m_dims
size_t * m_pDims
size_t * m_pScales
double * m_pTable
size_t m_product

Detailed Description

This represents a grid of values. It might be useful as a Q-table with Q-learning.


Constructor & Destructor Documentation

GClasses::GInstanceTable::GInstanceTable ( size_t  dims,
size_t *  pDims,
GRand rand 
)

dims specifies the number of feature dimensions. pDims specifies the number of discrete zero-based values for each feature dim.

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

Member Function Documentation

virtual void GClasses::GInstanceTable::beginIncrementalLearningInner ( sp_relation pFeatureRel,
sp_relation pLabelRel 
) [protected, virtual]
virtual bool GClasses::GInstanceTable::canImplicitlyHandleNominalFeatures ( ) [inline, protected, virtual]
virtual void GClasses::GInstanceTable::clear ( ) [virtual]

Clears the internal model.

Implements GClasses::GSupervisedLearner.

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

Serialize this table.

Implements GClasses::GSupervisedLearner.

virtual void GClasses::GInstanceTable::trainIncrementalInner ( const double *  pIn,
const double *  pOut 
) [protected, virtual]
virtual void GClasses::GInstanceTable::trainInner ( GMatrix features,
GMatrix labels 
) [protected, virtual]
virtual void GClasses::GInstanceTable::trainSparse ( GSparseMatrix features,
GMatrix labels 
) [virtual]

Member Data Documentation

size_t* GClasses::GInstanceTable::m_pDims [protected]