ArtmapModelStub Class Reference

ArtmapModelStub is a bridge class, coupling the ARTMAP implementation to the interface defined by ClassifierModel. More...

#include <ArtmapModelStub.h>

Inherits ClassifierModel.

Inheritance diagram for ArtmapModelStub:

Inheritance graph
[legend]
Collaboration diagram for ArtmapModelStub:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ArtmapModelStub (int numInputDims, int numOutputClasses)
 Creates an ARTMAP classifier with the specified number of input features and of output classes.
 ~ArtmapModelStub ()
 Destructor.
void setParams (PropertyList *cp)
 Sets any classifier-specific parameters.
void train (std::valarray< float > &in, int out)
 Trains the classifier to associate the input array of floating point values with the output label.
void test (std::valarray< float > &in, std::valarray< float > &out)
 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.
void load (ifstream *wgtFile, string &specialRequest)
 Loads the classifier's persistent state (for example, its weights) from the passed file stream.
void save (ofstream *wgtFile)
 Saves the classifier's persistent state to file.
int getLtmRequired ()
 Computes the amount of memory needed to hold the persistent state of the classifier.
int getOutputType (const string &name)
 Classifiers can return three kinds of outputs; given an output name, this method returns the output's type.
int getInt (const string &name)
 Returns the value of an int-valued classifier-specific output.
float getFloat (const string &name)
 Returns the value of an float-valued classifier-specific output.
string & getString (const string &name)
 Returns the value of a string-valued classifier-specific output.
void requestOutput (const string &name, ofstream *ost)
 Lets classifiers support outputs to file, which is the only way of managing very verbose outputs.
void closeStreams ()
 Close any streams left open by the requestOutput() method.

Detailed Description

ArtmapModelStub is a bridge class, coupling the ARTMAP implementation to the interface defined by ClassifierModel.


Constructor & Destructor Documentation

ArtmapModelStub::ArtmapModelStub int  numInputDims,
int  numOutputClasses
 

Creates an ARTMAP classifier with the specified number of input features and of output classes.

ArtmapModelStub::~ArtmapModelStub  ) 
 

Destructor.


Member Function Documentation

void ArtmapModelStub::closeStreams  )  [virtual]
 

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

Implements ClassifierModel.

float ArtmapModelStub::getFloat const string &  name  )  [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.

Implements ClassifierModel.

int ArtmapModelStub::getInt const string &  name  )  [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.

Implements ClassifierModel.

int ArtmapModelStub::getLtmRequired  )  [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).

Implements ClassifierModel.

int ArtmapModelStub::getOutputType const string &  name  )  [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

Implements ClassifierModel.

string & ArtmapModelStub::getString const string &  name  )  [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.

Implements ClassifierModel.

void ArtmapModelStub::load ifstream *  wgtFile,
string &  specialRequest
[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.

Implements ClassifierModel.

void ArtmapModelStub::requestOutput const string &  name,
ofstream *  ost
[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.

Implements ClassifierModel.

void ArtmapModelStub::save ofstream *  wgtFile  )  [virtual]
 

Saves the classifier's persistent state to file.

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

Implements ClassifierModel.

void ArtmapModelStub::setParams PropertyList cp  )  [virtual]
 

Sets any classifier-specific parameters.

Parameters:
cp A PropertyList object defining parameters and values.

Implements ClassifierModel.

void ArtmapModelStub::test std::valarray< float > &  in,
std::valarray< float > &  out
[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.

Implements ClassifierModel.

void ArtmapModelStub::train std::valarray< float > &  in,
int  out
[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.

Implements ClassifierModel.


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