ClassifierModel Class Reference

This is an abstract class defining the interface that must be implemented by a classifier to be used in Classer. More...

#include <ClassifierModel.h>

Inherited by ArtmapModelStub.

Inheritance diagram for ClassifierModel:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ~ClassifierModel ()
virtual void setParams (PropertyList *cp)=0
 Sets any classifier-specific parameters.
virtual void train (std::valarray< float > &in, int out)=0
 Trains the classifier to associate the input array of floating point values with the output label.
virtual void test (std::valarray< float > &in, std::valarray< float > &out)=0
 Tests the trained classifier, mapping the input array to a distributed output vector, which specified the likelihood that the input sample belongs to each of the output classes.
virtual void load (ifstream *wgtFile, string &specialRequest)=0
 Loads the classifier's persistent state (for example, its weights) from the passed file stream.
virtual void save (ofstream *wgtFile)=0
 Saves the classifier's persistent state to file.
virtual int getLtmRequired ()=0
 Computes the amount of memory needed to hold the persistent state of the classifier.
virtual int getOutputType (const string &name)=0
 Classifiers can return three kinds of outputs; given an output name, this method returns the output's type.
virtual int getInt (const string &name)=0
 Returns the value of an int-valued classifier-specific output.
virtual float getFloat (const string &name)=0
 Returns the value of an float-valued classifier-specific output.
virtual string & getString (const string &name)=0
 Returns the value of a string-valued classifier-specific output.
virtual void requestOutput (const string &name, ofstream *ost)=0
 Lets classifiers support outputs to file, which is the only way of managing very verbose outputs.
virtual void closeStreams ()=0
 Close any streams left open by the requestOutput() method.

Detailed Description

This is an abstract class defining the interface that must be implemented by a classifier to be used in Classer.


Constructor & Destructor Documentation

ClassifierModel::~ClassifierModel  )  [inline]
 


Member Function Documentation

virtual void ClassifierModel::closeStreams  )  [pure virtual]
 

Close any streams left open by the requestOutput() method.

Implemented in ArtmapModelStub.

virtual float ClassifierModel::getFloat const string &  name  )  [pure virtual]
 

Returns the value of an float-valued classifier-specific output.

Parameters:
name The name of the output of interest.
Returns:
The value of the output.

Implemented in ArtmapModelStub.

virtual int ClassifierModel::getInt const string &  name  )  [pure virtual]
 

Returns the value of an int-valued classifier-specific output.

Parameters:
name The name of the output of interest.
Returns:
The value of the output.

Implemented in ArtmapModelStub.

virtual int ClassifierModel::getLtmRequired  )  [pure virtual]
 

Computes the amount of memory needed to hold the persistent state of the classifier.

Returns:
The number of bytes required to store the classifier's long-term-memory (LTM).

Implemented in ArtmapModelStub.

virtual int ClassifierModel::getOutputType const string &  name  )  [pure virtual]
 

Classifiers can return three kinds of outputs; given an output name, this method returns the output's type.

Parameters:
name The name of the output of interest.
Returns:
0 - int, 1 - float, 2 - string

Implemented in ArtmapModelStub.

virtual string& ClassifierModel::getString const string &  name  )  [pure virtual]
 

Returns the value of a string-valued classifier-specific output.

Parameters:
name The name of the output of interest.
Returns:
The value of the output.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::load ifstream *  wgtFile,
string &  specialRequest
[pure virtual]
 

Loads the classifier's persistent state (for example, its weights) from the passed file stream.

Parameters:
wgtFile The input file stream to get the classifier state from.
specialRequest A place to put a classifier-specific request.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::requestOutput const string &  name,
ofstream *  ost
[pure virtual]
 

Lets classifiers support outputs to file, which is the only way of managing very verbose outputs.

The streams are then closed by calling the closeStreams() method.

Parameters:
name The name of the output of interest.
ost The output file stream to send the outputs to.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::save ofstream *  wgtFile  )  [pure virtual]
 

Saves the classifier's persistent state to file.

Parameters:
wgtFile The output file stream to save the classifier to.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::setParams PropertyList cp  )  [pure virtual]
 

Sets any classifier-specific parameters.

Parameters:
cp A PropertyList object defining parameters and values.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::test std::valarray< float > &  in,
std::valarray< float > &  out
[pure virtual]
 

Tests the trained classifier, mapping the input array to a distributed output vector, which specified the likelihood that the input sample belongs to each of the output classes.

For example, an output vector (0.5 0.5 0.0) implies that the sample is equally likely to belong to class 1 or class 2, whereas (0 0 1) implies the sample is predicted to be of class 3.

Parameters:
in The input vector for the sample.
out The output vector for the sample.

Implemented in ArtmapModelStub.

virtual void ClassifierModel::train std::valarray< float > &  in,
int  out
[pure virtual]
 

Trains the classifier to associate the input array of floating point values with the output label.

Parameters:
in An array of floating point feature values.
out The label with which to associate the inputs.

Implemented in ArtmapModelStub.


The documentation for this class was generated from the following file:
Generated on Tue Dec 13 11:00:26 2005 for Classer by  doxygen 1.4.3