Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::MinimumDistanceClassifier< T, I, C > Class Template Reference

#include <Classifier.h>

Inheritance diagram for prapi::MinimumDistanceClassifier< T, I, C >:

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

Detailed Description

template<class T, class I = std::string, class C = int>
class prapi::MinimumDistanceClassifier< T, I, C >

An implementation of the minimum distance classifier.

Each unknown sample is classified according to the class of the prototype sample that has the smallest proximity measure between it.


Public Methods

 MinimumDistanceClassifier (util::List< Sample< T, I, C > > *trainingSamples, ProximityMeasure< T > *measure, int classCount)
 Create a new MinimumDistance classifier with the given training samples, proximity measure and class count.

 MinimumDistanceClassifier (util::List< Sample< T, I, C > > &trainingSamples, ProximityMeasure< T > *measure, int classCount)
 Create a new MinimumDistance classifier with the given training samples, proximity measure and class count.

 MinimumDistanceClassifier (util::List< Sample< T, I, C > > &trainingSamples, ProximityMeasure< T > &measure, int classCount)
 Create a new MinimumDistance classifier with the given training samples, proximity measure and class count.

void setTrainingSamples (util::List< Sample< T, I, C > > *lst)
 Change the training samples held by this classifier.

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


Constructor & Destructor Documentation

template<class T, class I = std::string, class C = int>
prapi::MinimumDistanceClassifier< T, I, C >::MinimumDistanceClassifier util::List< Sample< T, I, C > > *    trainingSamples,
ProximityMeasure< T > *    measure,
int    classCount
[inline]
 

Create a new MinimumDistance classifier with the given training samples, proximity measure and class count.

(Autorelease measure.)

template<class T, class I = std::string, class C = int>
prapi::MinimumDistanceClassifier< T, I, C >::MinimumDistanceClassifier util::List< Sample< T, I, C > > &    trainingSamples,
ProximityMeasure< T > *    measure,
int    classCount
[inline]
 

Create a new MinimumDistance classifier with the given training samples, proximity measure and class count.

(Autorelease measure.)


Member Function Documentation

template<class T, class I, class C>
C prapi::MinimumDistanceClassifier< T, I, C >::getClassification Sample< T, I, C > &    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, C >.

template<class T, class I = std::string, class C = int>
void prapi::MinimumDistanceClassifier< T, I, C >::setTrainingSamples util::List< Sample< T, I, C > > *    lst [inline, virtual]
 

Change the training samples held by this classifier.

Parameters:
lst  the new samples

Reimplemented from prapi::Classifier< T, I, C >.


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.