LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::supervisedInstanceClassifier Class Reference

Abstract class, parent of all supervised instance classifiers. More...

#include <ltiSupervisedInstanceClassifier.h>

Inheritance diagram for lti::supervisedInstanceClassifier:
Inheritance graph
[legend]
Collaboration diagram for lti::supervisedInstanceClassifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 supervisedInstanceClassifier ()
 supervisedInstanceClassifier (const supervisedInstanceClassifier &other)
virtual const char * getTypeName () const
supervisedInstanceClassifiercopy (const supervisedInstanceClassifier &other)
supervisedInstanceClassifieroperator= (const supervisedInstanceClassifier &other)
const parametersgetParameters () const
virtual bool train (const dmatrix &input, const ivector &ids)=0
virtual bool classify (const dvector &feature, outputVector &result) const =0

Protected Member Functions

bool makeOutputTemplate (const int &outSize, const dmatrix &data, const ivector &ids)

Detailed Description

Abstract class, parent of all supervised instance classifiers.

This class defines the interface for all supervised train methods which are not dependant on time.


Constructor & Destructor Documentation

lti::supervisedInstanceClassifier::supervisedInstanceClassifier (  ) 

default constructor

lti::supervisedInstanceClassifier::supervisedInstanceClassifier ( const supervisedInstanceClassifier other  ) 

copy constructor

Parameters:
other the object to be copied

Member Function Documentation

virtual bool lti::supervisedInstanceClassifier::classify ( const dvector feature,
outputVector result 
) const [pure virtual]

Classification.

Classifies the feature and returns the outputVector with the classification result.

Parameters:
feature the vector to be classified
result the result of the classification
Returns:
false if an error occurred during classification else true

Implemented in lti::crispDecisionTree, lti::kNNClassifier, lti::lvq, lti::MLP, lti::rbf, lti::shClassifier, and lti::svm.

supervisedInstanceClassifier& lti::supervisedInstanceClassifier::copy ( const supervisedInstanceClassifier other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::classifier.

Reimplemented in lti::crispDecisionTree, lti::decisionTree, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::rbf, lti::shClassifier, and lti::svm.

Referenced by operator=().

const parameters& lti::supervisedInstanceClassifier::getParameters (  )  const
virtual const char* lti::supervisedInstanceClassifier::getTypeName (  )  const [virtual]

returns the name of this type ("supervisedInstanceClassifier")

Reimplemented from lti::classifier.

Reimplemented in lti::crispDecisionTree, lti::decisionTree, lti::kNNClassifier, lti::manualCrispDecisionTree, lti::MLP, lti::rbf, lti::shClassifier, and lti::svm.

bool lti::supervisedInstanceClassifier::makeOutputTemplate ( const int &  outSize,
const dmatrix data,
const ivector ids 
) [protected]

Sets the outputTemplate probability distributions according to the classification of the given data.

The distributions are built by the follwing rule:

  1. Classify next data vector
  2. For the position in the output with the highest probability increase the count for the actual id by one.
  3. While there is more data go back to 1
  4. For each position: divide each count by total number of counts

This results in a distribution over the ids that caused highest probability for each position of the output.

Parameters:
outSize size of the outputTemplate
data train of validation data
ids ids of the data-vectors
Returns:
false upon error
supervisedInstanceClassifier& lti::supervisedInstanceClassifier::operator= ( const supervisedInstanceClassifier other  )  [inline]

Alias for "copy".

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::classifier.

Reimplemented in lti::crispDecisionTree, lti::decisionTree, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::rbf, lti::shClassifier, and lti::svm.

References copy().

virtual bool lti::supervisedInstanceClassifier::train ( const dmatrix input,
const ivector ids 
) [pure virtual]

Supervised training.

The vectors in the input matrix must be trained using as "known" classes the values given in ids.

Parameters:
input the matrix with input vectors (each row is a training vector)
ids the output classes ids for the input vectors.
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Implemented in lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::rbf, lti::shClassifier, and lti::svm.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:27:00 2010 for LTI-Lib by Doxygen 1.6.1