GClasses
|
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>
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 GIncrementalTransform * | loadIncrementalTransform (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 GSupervisedLearner * | loadSupervisedLearner (GDomNode *pNode) |
Loads a supervised learning algorithm (or an incremental learner) from a DOM. | |
virtual GIncrementalLearner * | loadIncrementalLearner (GDomNode *pNode) |
Loads an incremental learner from a DOM. | |
virtual GCollaborativeFilter * | loadCollaborativeFilter (GDomNode *pNode) |
Loads a collaborative filtering algorithm from a DOM. | |
GRand & | rand () |
Returns the random number generator associated with this object. | |
Protected Attributes | |
bool | m_throwIfClassNotFound |
GRand & | m_rand |
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.
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] |
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.
GRand& GClasses::GLearnerLoader::m_rand [protected] |
bool GClasses::GLearnerLoader::m_throwIfClassNotFound [protected] |