Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ProximityModifier< operation, T > Class Template Reference

#include <ProximityMeasure.h>

Inheritance diagram for prapi::ProximityModifier< operation, T >:

prapi::ProximityMeasure< T > Object List of all members.

Detailed Description

template<class operation, class T>
class prapi::ProximityModifier< operation, T >

A general modifier for proximity measures.

This modifier may be used to perform calculations on proximity values in a general way. Stl functionals (plus,minus,multiplies,divides) are used to indicate the performed operations. ProximityModifiers can be used as any proximity measure - they just modify the value returned by their internal proximity measure in a certain way.

Example:

 //Create a proximity modifier that adds 1.0 to the Euclidean distance between samples
 ProximityModifier<plus<double>,double> adder(new EuclideanDistance<double>, 1.0);

 //Create a proximity modifier that divides the Euclidean distance between samples by two
 ProximityModifier<divides<double>,double> adder(new EuclideanDistance<double>, 2.0);
 


Public Methods

 ProximityModifier (ProximityMeasure< T > *measure, double value)
 Create a new modifier that uses the given proximity measure.

 ProximityModifier (ProximityMeasure< T > &measure, double value)
 Create a new modifier that uses the given proximity measure.

virtual ~ProximityModifier ()
double getProximity (const util::List< T > &sample, const util::List< T > &model, double stopAfter) const throw (ProximityException&)
 Proximity between two lists.


Constructor & Destructor Documentation

template<class operation, class T>
prapi::ProximityModifier< operation, T >::ProximityModifier ProximityMeasure< T > *    measure,
double    value
[inline]
 

Create a new modifier that uses the given proximity measure.

Note that if you use this constructor, the memory pointed by measure is automatically released upon the deletion of the modifier.

Parameters:
measure  a pointer to the actual measure to be used
value  the value to modify the measured proximities with

template<class operation, class T>
prapi::ProximityModifier< operation, T >::ProximityModifier ProximityMeasure< T > &    measure,
double    value
[inline]
 

Create a new modifier that uses the given proximity measure.

Parameters:
measure  a reference to the actual measure to be used
value  the value to modify the measured proximities with


Member Function Documentation

template<class operation, class T>
double prapi::ProximityModifier< operation, T >::getProximity const util::List< T > &    sample,
const util::List< T > &    model,
double    stopAfter
const throw (ProximityException&) [inline, virtual]
 

Proximity between two lists.

Parameters:
sample  the list to be classified
model  the model
stopAfter  A value that can be used in optimizing the performance of a proximity measure. Classifiers may set this value to inform the proximity measure to stop if it notices the proximity will be over a certain value. For example, the kNN classifier sets this value to the kth smallest proximity so far. If a sample is not closer than that, then it makes no sense to inspect it any more.

Implements prapi::ProximityMeasure< T >.


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.