latest version v1.9 - last update 10 Apr 2010 |
Abstract parent class for all classifiers. More...
#include <ltiClassifier.h>
Classes | |
class | invalidMethodException |
Exception thrown when a method of a functor is not implemented for a specific parameter set. More... | |
class | invalidOutputException |
Exception thrown when the output objects has not been set yet. More... | |
class | invalidParametersException |
Exception thrown when the parameters are not set. More... | |
class | outputTemplate |
The outputTemplate stores the relation between the different positions (sometimes called internal ids) of a classification result and the ids. More... | |
class | outputVector |
An output vector is the result of classifying data with any classifier. More... | |
class | parameters |
the parameters for the class classifier More... | |
class | parametersOutOfRangeException |
Exception thrown when a parameter is out of range. More... | |
Public Member Functions | |
classifier () | |
classifier (const classifier &other) | |
virtual | ~classifier () |
virtual const char * | getTypeName () const |
classifier & | copy (const classifier &other) |
classifier & | operator= (const classifier &other) |
virtual classifier * | clone () const =0 |
virtual bool | validParameters () const |
const parameters & | getParameters () const |
virtual bool | setParameters (const parameters &theParam) |
virtual void | setOutputTemplate (const outputTemplate &theOutputTemplate) |
const outputTemplate & | getOutputTemplate () const |
virtual bool | write (ioHandler &handler, const bool complete=true) const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Progress Info | |
void | setProgressObject (const progressInfo &progBox) |
void | removeProgressObject () |
bool | validProgressObject () const |
progressInfo & | getProgressObject () |
const progressInfo & | getProgressObject () const |
Static Public Attributes | |
static const int | unknownObj |
static const int | noObject |
static const double | nullProbability |
Protected Attributes | |
parameters * | params |
progressInfo * | progressBox |
outputTemplate | outTemplate |
Abstract parent class for all classifiers.
The classifier class encloses a number of other important classes:
Classifiers can be diveded into two large groups: supervised and unsupervised. These two groups have the base classes supervisedClassifier and unsupervisedClassifier which are subclasses of this class. Examples for the first type are RBF networks, multi layer perceptron, maximum likelihood classifiers etc. The second type comprises statistic and neural clustering methods.
All classifiers return an outputVector when classify is called. The outputVector is created by the classifier by applying its outputTemplate to the regular dvector which results from the classification process.
lti::classifier::classifier | ( | ) |
default constructor
lti::classifier::classifier | ( | const classifier & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::classifier::~classifier | ( | ) | [virtual] |
destructor
virtual classifier* lti::classifier::clone | ( | ) | const [pure virtual] |
returns a pointer to a clone of this functor.
Implemented in lti::adaptiveKMeans, lti::bagging, lti::competitiveAgglomeration, lti::DBScan< T >, lti::fuzzyCMeans, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kMeansClustering, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, and lti::svm.
classifier& lti::classifier::copy | ( | const classifier & | other | ) |
return the last message set with setStatusString().
This will never return 0. If no status-string has been set yet an empty string (pointer to a string with only the char(0)) will be returned. set a status string.
msg | the const string to be reported next time by getStatusString(). The given string will be copied This message will be usually set within the apply methods to indicate an error cause. |
Note that the change of the status string is not considered as a change in the functor status. copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::ioObject.
Reimplemented in lti::adaptiveKMeans, lti::bagging, lti::centroidClustering, lti::clustering, lti::competitiveAgglomeration, lti::crispDecisionTree, lti::DBScan< T >, lti::decisionTree, lti::fuzzyCMeans, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kMeansClustering, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, lti::supervisedInstanceClassifier, lti::supervisedSequenceClassifier, lti::svm, and lti::unsupervisedClassifier.
Referenced by operator=().
const outputTemplate& lti::classifier::getOutputTemplate | ( | ) | const |
get a const reference to the outputTemplate
Referenced by lti::kNNClassifier::getColumnId().
const parameters& lti::classifier::getParameters | ( | ) | const |
returns used parameters
Reimplemented in lti::adaptiveKMeans, lti::bagging, lti::centroidClustering, lti::clustering, lti::competitiveAgglomeration, lti::crispDecisionTree, lti::DBScan< T >, lti::decisionTree, lti::fuzzyCMeans, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kMeansClustering, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, lti::supervisedInstanceClassifier, lti::supervisedSequenceClassifier, lti::svm, and lti::unsupervisedClassifier.
const progressInfo& lti::classifier::getProgressObject | ( | ) | const |
get progress object
progressInfo& lti::classifier::getProgressObject | ( | ) |
get progress object
virtual const char* lti::classifier::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("classifier")
Reimplemented from lti::ioObject.
Reimplemented in lti::adaptiveKMeans, lti::bagging, lti::centroidClustering, lti::clustering, lti::competitiveAgglomeration, lti::crispDecisionTree, lti::DBScan< T >, lti::decisionTree, lti::fuzzyCMeans, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kMeansClustering, lti::kNNClassifier, lti::manualCrispDecisionTree, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, lti::supervisedInstanceClassifier, lti::supervisedSequenceClassifier, lti::svm, and lti::unsupervisedClassifier.
classifier& lti::classifier::operator= | ( | const classifier & | other | ) | [inline] |
Alias for "copy".
Reimplemented from lti::ioObject.
Reimplemented in lti::adaptiveKMeans, lti::bagging, lti::competitiveAgglomeration, lti::crispDecisionTree, lti::DBScan< T >, lti::decisionTree, lti::fuzzyCMeans, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kNNClassifier, lti::lvq, lti::manualCrispDecisionTree, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, lti::supervisedInstanceClassifier, lti::supervisedSequenceClassifier, and lti::svm.
References copy().
virtual bool lti::classifier::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::ioObject.
Reimplemented in lti::bagging, lti::centroidClustering, lti::crispDecisionTree, lti::decisionTree, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kNNClassifier, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, and lti::svm.
void lti::classifier::removeProgressObject | ( | ) |
remove the active progress object
virtual void lti::classifier::setOutputTemplate | ( | const outputTemplate & | theOutputTemplate | ) | [virtual] |
sets the classifier's outputTemplate This member makes a copy of theOutputTemplate: the classifier will keep its own copy of the outputTemplate
virtual bool lti::classifier::setParameters | ( | const parameters & | theParam | ) | [virtual] |
sets the classifier's parameters.
This member makes a copy of theParam: the classifier will keep its own copy of the parameters!
Reimplemented in lti::fuzzyCMeans.
void lti::classifier::setProgressObject | ( | const progressInfo & | progBox | ) |
set a progress object
A clone of the given object will be generated.
virtual bool lti::classifier::validParameters | ( | ) | const [inline, virtual] |
returns true if the parameters are valid
References params.
bool lti::classifier::validProgressObject | ( | ) | const |
return true if a valid progressInfo object has already been setted
virtual bool lti::classifier::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::ioObject.
Reimplemented in lti::bagging, lti::centroidClustering, lti::crispDecisionTree, lti::decisionTree, lti::hmmClassifier, lti::hmmOnlineClassifier, lti::kNNClassifier, lti::MLP, lti::MSTClustering< U >, lti::rbf, lti::shClassifier, lti::SOFM, lti::SOFM2D, and lti::svm.
const int lti::classifier::noObject [static] |
constant to indicate "no object"
const double lti::classifier::nullProbability [static] |
all probabilities under this value will be considered as 0
outputTemplate lti::classifier::outTemplate [protected] |
the status string written with setStatusString
the empty string returned if the statusString is empty The outputTemplate for this classifier
parameters* lti::classifier::params [protected] |
returns current parameters.
(non const! -> protected) current parameters.
Referenced by validParameters().
progressInfo* lti::classifier::progressBox [protected] |
current progress object
const int lti::classifier::unknownObj [static] |
constant to indicate an unknown object