Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ProximityMultiplier< T > Class Template Reference

#include <ProximityMeasure.h>

Inheritance diagram for prapi::ProximityMultiplier< T >:

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

Detailed Description

template<class T>
class prapi::ProximityMultiplier< T >

Multiplier is a wrap-up measure that multiplies the value provided by another measure by a constant value.

It may be used in scaling the measured values.

Example:

 MyProximityMeasure myProximity; //Inherited from ProximityMeasure<float>

 //Create a kNN classifier that uses MyProximityMeasure and scales the
 //proximity values to the range [0,1]. The values min and max can
 //be obtained for example from ProximityMatrix.
 kNNClassifier<float> knn(trainingSamples,
                          new ProximityMultiplier<float>(new ProximityAdder<float>(myProximity,
                                                                                  -min),
                                                         1/(max-min)));
 
Deprecated:
Use ProximityModifier instead
See also:
ProximityModifier , ProximityAdder , ProximityMatrix , Classifier


Public Methods

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

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

virtual ~ProximityMultiplier ()
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 T>
prapi::ProximityMultiplier< T >::ProximityMultiplier ProximityMeasure< T > *    measure,
double    value
[inline]
 

Create a new Multiplier 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 Multiplier.

Parameters:
measure  a pointer to the actual measure to be used
value  the value by which the measured proximities are to be multiplied

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

Create a new Multiplier that uses the given proximity measure.

Parameters:
measure  a pointer to the actual measure to be used
value  the value by which the measured proximities are to be multiplied


Member Function Documentation

template<class T>
double prapi::ProximityMultiplier< 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.