latest version v1.9 - last update 10 Apr 2010 |
Abstract class, parent of all supervised classifiers for sequences. More...
#include <ltiSupervisedSequenceClassifier.h>
Public Member Functions | |
supervisedSequenceClassifier () | |
supervisedSequenceClassifier (const supervisedSequenceClassifier &other) | |
virtual const char * | getTypeName () const |
supervisedSequenceClassifier & | copy (const supervisedSequenceClassifier &other) |
supervisedSequenceClassifier & | operator= (const supervisedSequenceClassifier &other) |
const parameters & | getParameters () 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) |
Abstract class, parent of all supervised classifiers for sequences.
This class defines the interface for training methods of classifiers that work on time series.
lti::supervisedSequenceClassifier::supervisedSequenceClassifier | ( | ) |
default constructor
lti::supervisedSequenceClassifier::supervisedSequenceClassifier | ( | const supervisedSequenceClassifier & | other | ) |
copy constructor
other | the object to be copied |
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.
observations | the sequence to be classified | |
result | the result of the classification |
Implemented in lti::hmmClassifier.
supervisedSequenceClassifier& lti::supervisedSequenceClassifier::copy | ( | const supervisedSequenceClassifier & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
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:
This results in a distribution over the ids that caused highest probability for each position of the output.
outSize | size of the outputTemplate | |
data | train of validation data sequences | |
ids | ids of the data-vectors |
supervisedSequenceClassifier& lti::supervisedSequenceClassifier::operator= | ( | const supervisedSequenceClassifier & | other | ) | [inline] |
Alias for "copy".
other | the functor to be copied |
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
.
input | vector of training sequences | |
ids | the classes of the training sequences |
Implemented in lti::hmmClassifier.