GClasses

GClasses::GLearnerLoader Class Reference

This class is for loading various learning algorithms from a DOM. When any learning algorithm is saved, it calls baseDomNode, which creates (among other things) a field named "class" which specifies the class name of the algorithm. This class contains methods that will recognize any of the classes in this library and load them. If it doesn't recognize a class, it will either return NULL or throw and exception, depending on the flags you pass to the constructor. Obviously this loader won't recognize any classes that you make. Therefore, you should overload the corresponding method in this class with a new method that will first recognize and load your classes, and then call these methods to handle other types. More...

#include <GLearner.h>

List of all members.

Public Member Functions

 GLearnerLoader (GRand &rand, bool throwIfClassNotFound=true)
 Constructor. If throwIfClassNotFound is true, then all of the methods in this class will throw an exception of the DOM refers to an unrecognized class. If throwIfClassNotFound is false, then NULL will be returned if the class is not recognized.
virtual ~GLearnerLoader ()
virtual GIncrementalTransformloadIncrementalTransform (GDomNode *pNode)
 Loads an incremental transform (or a two-way incremental transform) from a DOM.
virtual
GTwoWayIncrementalTransform
loadTwoWayIncrementalTransform (GDomNode *pNode)
 Loads a two-way transform from a DOM.
virtual GSupervisedLearnerloadSupervisedLearner (GDomNode *pNode)
 Loads a supervised learning algorithm (or an incremental learner) from a DOM.
virtual GIncrementalLearnerloadIncrementalLearner (GDomNode *pNode)
 Loads an incremental learner from a DOM.
virtual GCollaborativeFilterloadCollaborativeFilter (GDomNode *pNode)
 Loads a collaborative filtering algorithm from a DOM.
GRandrand ()
 Returns the random number generator associated with this object.

Protected Attributes

bool m_throwIfClassNotFound
GRandm_rand

Detailed Description

This class is for loading various learning algorithms from a DOM. When any learning algorithm is saved, it calls baseDomNode, which creates (among other things) a field named "class" which specifies the class name of the algorithm. This class contains methods that will recognize any of the classes in this library and load them. If it doesn't recognize a class, it will either return NULL or throw and exception, depending on the flags you pass to the constructor. Obviously this loader won't recognize any classes that you make. Therefore, you should overload the corresponding method in this class with a new method that will first recognize and load your classes, and then call these methods to handle other types.


Constructor & Destructor Documentation

GClasses::GLearnerLoader::GLearnerLoader ( GRand rand,
bool  throwIfClassNotFound = true 
) [inline]

Constructor. If throwIfClassNotFound is true, then all of the methods in this class will throw an exception of the DOM refers to an unrecognized class. If throwIfClassNotFound is false, then NULL will be returned if the class is not recognized.

virtual GClasses::GLearnerLoader::~GLearnerLoader ( ) [inline, virtual]

Member Function Documentation

virtual GCollaborativeFilter* GClasses::GLearnerLoader::loadCollaborativeFilter ( GDomNode pNode) [virtual]

Loads a collaborative filtering algorithm from a DOM.

virtual GIncrementalLearner* GClasses::GLearnerLoader::loadIncrementalLearner ( GDomNode pNode) [virtual]

Loads an incremental learner from a DOM.

virtual GIncrementalTransform* GClasses::GLearnerLoader::loadIncrementalTransform ( GDomNode pNode) [virtual]

Loads an incremental transform (or a two-way incremental transform) from a DOM.

virtual GSupervisedLearner* GClasses::GLearnerLoader::loadSupervisedLearner ( GDomNode pNode) [virtual]

Loads a supervised learning algorithm (or an incremental learner) from a DOM.

virtual GTwoWayIncrementalTransform* GClasses::GLearnerLoader::loadTwoWayIncrementalTransform ( GDomNode pNode) [virtual]

Loads a two-way transform from a DOM.

GRand& GClasses::GLearnerLoader::rand ( ) [inline]

Returns the random number generator associated with this object.


Member Data Documentation