latest version v1.9 - last update 10 Apr 2010 |
Implements a sparse histogram-based classifier, such as the one described in B. More...
#include <ltiSHClassifier.h>
Classes | |
class | parameters |
the parameters for the class shClassifier More... | |
Public Member Functions | |
shClassifier () | |
shClassifier (const shClassifier &other) | |
virtual | ~shClassifier () |
virtual const char * | getTypeName () const |
shClassifier & | copy (const shClassifier &other) |
shClassifier & | operator= (const shClassifier &other) |
virtual classifier * | clone () const |
const parameters & | getParameters () const |
virtual bool | train (const dmatrix &input, const ivector &ids) |
virtual bool | trainObject (const dmatrix &input, int &id) |
virtual bool | classify (const dvector &feature, outputVector &result) const |
virtual bool | write (ioHandler &handler, const bool complete=true) const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Implements a sparse histogram-based classifier, such as the one described in B.
Schiele, J. L. Crowley: Recognition without Correspondence using Multidimensional Receptive Field Histograms.
lti::shClassifier::shClassifier | ( | ) |
default constructor
lti::shClassifier::shClassifier | ( | const shClassifier & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::shClassifier::~shClassifier | ( | ) | [virtual] |
destructor
virtual bool lti::shClassifier::classify | ( | const dvector & | feature, | |
outputVector & | result | |||
) | const [virtual] |
Classification.
Classifies the feature and returns the outputVector object with the classification result.
NOTE: This method is NOT really const. Although the main members of the shClassifier are not changed some state variables used for efficiency are. Thus, it is not save to use the same instance of the shClassifier in two different threads.
feature | pattern to be classified | |
result | of the classifications as a classifier::outputVector |
Implements lti::supervisedInstanceClassifier.
virtual classifier* lti::shClassifier::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this clustering.
Implements lti::classifier.
shClassifier& lti::shClassifier::copy | ( | const shClassifier & | other | ) |
copy data of "other" clustering.
other | the clustering to be copied |
Reimplemented from lti::supervisedInstanceClassifier.
const parameters& lti::shClassifier::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::supervisedInstanceClassifier.
virtual const char* lti::shClassifier::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("shClassifier")
Reimplemented from lti::supervisedInstanceClassifier.
shClassifier& lti::shClassifier::operator= | ( | const shClassifier & | other | ) |
alias for copy member
other | the clustering to be copied |
Reimplemented from lti::supervisedInstanceClassifier.
virtual bool lti::shClassifier::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
read the classifier from the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::classifier.
Supervised training.
The vectors in the input
matrix are arranged row-wise, i.e. each row contains one data vector. The ids
vector contains the class label for each row. This functor implements the SMO algorithm by J.C. Platt. All classes are modeled using the same kernel function, given in the parameters object.
input | the matrix with the input vectors (each row is a training vector) | |
ids | vector of class ids for each input point |
Implements lti::supervisedInstanceClassifier.
virtual bool lti::shClassifier::trainObject | ( | const dmatrix & | input, | |
int & | id | |||
) | [virtual] |
Adds an object to this classifier.
The id is given automatically and returned in the parameter.
virtual bool lti::shClassifier::write | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | const [virtual] |
write the classifier in the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::classifier.