Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::MultiClassifier< T, I > Class Template Reference

#include <MultiClassifier.h>

Inheritance diagram for prapi::MultiClassifier< T, I >:

prapi::Classifier< T, I, int > EventSource< ClassificationEvent< T, I, int > > Object List of all members.

Detailed Description

template<class T, class I = std::string>
class prapi::MultiClassifier< T, I >

MultiClassifier combines class rankings from different classifiers and produces an overall result using a number of combination schemes.

Example:

 kNNClassifier<double> knn(samples,new EuclideanDistance<double>,4,3);
 MahalanobisClassifier<double> maha(samples,4);
 List<Classifier<double>*> lst(2);
 lst += &knn; lst += &maha;

 MultiClassifier<double> classifier(lst, new RankCombiner::BordaCount(4));
 classifier.holdOut(testingSamples);
 


Public Methods

 MultiClassifier (const util::List< Classifier< T, I, int > * > &classifiers, RankCombiner *combiner)
 Create a new MultiClassifier.

 MultiClassifier (const util::List< Classifier< T, I, int > * > &classifiers, RankCombiner &combiner)
 Create a new MultiClassifier.

int getClassification (Sample< T, I, int > &sample) throw (ClassificationException&)
 Get the classification for a single sample.

void leaveOneOut (void) throw (ClassificationException&)
 Perform a leave-one-out test on the training data.


Constructor & Destructor Documentation

template<class T, class I = std::string>
prapi::MultiClassifier< T, I >::MultiClassifier const util::List< Classifier< T, I, int > * > &    classifiers,
RankCombiner   combiner
[inline]
 

Create a new MultiClassifier.

The classifier will combine rankings from different classifiers.

Parameters:
classifiers  the classifiers whose rankings are combined
combiner  a rank combiner that is able to produce a single class index out of multiple rankings. (automatically deleted)

template<class T, class I = std::string>
prapi::MultiClassifier< T, I >::MultiClassifier const util::List< Classifier< T, I, int > * > &    classifiers,
RankCombiner   combiner
[inline]
 

Create a new MultiClassifier.

The classifier will combine rankings from different classifiers.

Parameters:
classifiers  the classifiers whose rankings are combined
combiner  a rank combiner that is able to produce a single class index out of multiple rankings.


Member Function Documentation

template<class T, class I>
int prapi::MultiClassifier< T, I >::getClassification Sample< T, I, int > &    sample throw (ClassificationException&) [virtual]
 

Get the classification for a single sample.

This method is used by holdOut and leaveOneOut to classify each sample. Subclasses must override this method.

Parameters:
sample  the sample to be classified
Returns:
the classification. Simple classfiers (like NN or kNN) use integers. More sophisticated ones may use any classification type.
See also:
Sample for more information.

Implements prapi::Classifier< T, I, int >.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.