Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Pattern Recognition - Classify - ClassifyKNearestNeighbourBodyC
 

  PUBLIC
ClassifyKNearestNeighbourBodyC::ClassifyKNearestNeighbourBodyC(const DataSet2C &,UIntT,const DistanceC &)
ClassifyKNearestNeighbourBodyC::Search(const VectorC &,UIntT) const
ClassifyKNearestNeighbourBodyC::Classify(const VectorC &) const
ClassifyKNearestNeighbourBodyC::Confidence(const VectorC &) const
ClassifyKNearestNeighbourBodyC::K(void) const
ClassifyVectorBodyC::Classify(const VectorC &) const
ClassifyVectorBodyC::Confidence(const VectorC &) const
ClassifyVectorBodyC::Labels(void) const
RCBodyVC::Save(ostream &) const
RCBodyVC::Save(BinOStreamC &) const
RCBodyVC::Copy(void) const
RCBodyVC::DeepCopy(UIntT) const
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   ClassifyKNearestNeighbourBodyC   
 
k nearest neighbours classifier.
 
include "Ravl/PatternRec/ClassifyKNearestNeighbour.hh"
Source file:Ravl/PatternRec/Classify/ClassifyKNearestNeighbour.hh
User Level:Develop
Library:RavlPatternRec
In Scope:RavlN

Comments:
Classify probe vector as the most common amoung its k nearest neighbours. If there's a conflict the label with the smallest average distance is used.

Parent Classes: Derived Classes: Variables:
UIntT defaultK;
Number of samples to use in classification.

DistanceC distanceMetric;
Distance metric to use.

DataSet2C data;

Methods:
ClassifyKNearestNeighbourBodyC(const DataSet2C<SampleVectorC,SampleLabelC> & data,UIntT defaultK = 5,const DistanceC & xdistMetric = DistanceSqrEuclideanC ())
Default constructor.

SArray1dC<Tuple2C<UIntT,RealT>> Search(const VectorC & ex,UIntT k) const
Search for the the 'k' nearest neighbours.
Returns the label and the distance for the 'k' nearest neighbours.

UIntT Classify(const VectorC & data) const
Classify vector 'data' return the most likely label.

VectorC Confidence(const VectorC & data) const
Estimate the confidence for each label.
The meaning of the confidence assigned to each label depends on the classifier used. The higher the confidence the more likely it is the label is correct.

UIntT K() const
Number of samples to use when classifying.

#include "Ravl/PatternRec/ClassifyVector.hh"
UIntT Classify(const VectorC & data) const
Classify vector 'data' return the most likely label.

VectorC Confidence(const VectorC & data) const
Estimate the confidence for each label.
The meaning of the confidence assigned to each label depends on the classifier used. The higher the confidence the more likely it is the label is correct.

UIntT Labels() const
Returns the maximum number of output labels.

#include "Ravl/RCHandleV.hh"
bool Save(ostream & out) const
Save to stream 'out'.

bool Save(BinOStreamC & out) const
Save to binary stream 'out'.

RCBodyVC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002