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

lti::supervisedSequenceClassifier Class Reference

Abstract class, parent of all supervised classifiers for sequences. More...

#include <ltiSupervisedSequenceClassifier.h>

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

List of all members.

Public Member Functions

 supervisedSequenceClassifier ()
 supervisedSequenceClassifier (const supervisedSequenceClassifier &other)
virtual const char * getTypeName () const
supervisedSequenceClassifiercopy (const supervisedSequenceClassifier &other)
supervisedSequenceClassifieroperator= (const supervisedSequenceClassifier &other)
const parametersgetParameters () const
virtual bool train (const std::vector< sequence< dvector > > &input, const ivector &ids)=0
virtual bool classify (const sequence< dvector > &observations, outputVector &result)=0

Protected Member Functions

bool makeOutputTemplate (const int &outSize, const std::vector< sequence< dvector > > &data, const ivector &ids)

Detailed Description

Abstract class, parent of all supervised classifiers for sequences.

This class defines the interface for training methods of classifiers that work on time series.


Constructor & Destructor Documentation

lti::supervisedSequenceClassifier::supervisedSequenceClassifier (  ) 

default constructor

lti::supervisedSequenceClassifier::supervisedSequenceClassifier ( const supervisedSequenceClassifier other  ) 

copy constructor

Parameters:
other the object to be copied

Member Function Documentation

virtual bool lti::supervisedSequenceClassifier::classify ( const sequence< dvector > &  observations,
outputVector result 
) [pure virtual]

Classification.

Classifies the sequence of features and returns the outputVector with the classification result. Since sequence classifiers usually keep an inner state, this method is not const.

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

Implemented in lti::hmmClassifier.

supervisedSequenceClassifier& lti::supervisedSequenceClassifier::copy ( const supervisedSequenceClassifier 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::hmmClassifier, and lti::hmmOnlineClassifier.

Referenced by operator=().

const parameters& lti::supervisedSequenceClassifier::getParameters (  )  const

returns used parameters

Reimplemented from lti::classifier.

Reimplemented in lti::hmmClassifier, and lti::hmmOnlineClassifier.

virtual const char* lti::supervisedSequenceClassifier::getTypeName (  )  const [virtual]

returns the name of this type ("supervisedSequenceClassifier")

Reimplemented from lti::classifier.

Reimplemented in lti::hmmClassifier, and lti::hmmOnlineClassifier.

bool lti::supervisedSequenceClassifier::makeOutputTemplate ( const int &  outSize,
const std::vector< sequence< dvector > > &  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 sequence
  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 sequences
ids ids of the data-vectors
Returns:
false upon error
supervisedSequenceClassifier& lti::supervisedSequenceClassifier::operator= ( const supervisedSequenceClassifier 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::hmmClassifier, and lti::hmmOnlineClassifier.

References copy().

virtual bool lti::supervisedSequenceClassifier::train ( const std::vector< sequence< dvector > > &  input,
const ivector ids 
) [pure virtual]

Supervised sequence training.

The sequences in the input vector are used for training the sequence classifier. Each sequence is associated with an id given in the vector ids.

Parameters:
input vector of training sequences
ids the classes of the training sequences
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Implemented in lti::hmmClassifier.


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