LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::bhattacharyyaDistOfSubset Class Reference

The class implements the bhattacharyya distance as cost function. More...

#include <ltiBhattacharyyaDistOfSubset.h>

Inheritance diagram for lti::bhattacharyyaDistOfSubset:
Inheritance graph
[legend]
Collaboration diagram for lti::bhattacharyyaDistOfSubset:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 bhattacharyyaDistOfSubset ()
 bhattacharyyaDistOfSubset (const bhattacharyyaDistOfSubset &other)
virtual ~bhattacharyyaDistOfSubset ()
virtual const char * getTypeName () const
virtual void setSrc (const dmatrix &src, const ivector &srcIds)
virtual bool apply (const std::list< int > &in, double &dist)
bhattacharyyaDistOfSubsetcopy (const bhattacharyyaDistOfSubset &other)
bhattacharyyaDistOfSubsetoperator= (const bhattacharyyaDistOfSubset &other)
virtual functorclone () const

Protected Attributes

std::list< dmatrixclusters

Detailed Description

The class implements the bhattacharyya distance as cost function.

The cost function evaluates a subset of features from a dataset. First you have to initialize this class with the hole data set and the ids to which cluster each data point belongs. To do this you have to call the setSrc method. This must be done before you can compute the cost function. Then you can choose a subset of features. The cost function then will be the average bhattacharyya distance of all clusters.


Constructor & Destructor Documentation

lti::bhattacharyyaDistOfSubset::bhattacharyyaDistOfSubset (  ) 

default constructor

lti::bhattacharyyaDistOfSubset::bhattacharyyaDistOfSubset ( const bhattacharyyaDistOfSubset other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::bhattacharyyaDistOfSubset::~bhattacharyyaDistOfSubset (  )  [virtual]

destructor


Member Function Documentation

virtual bool lti::bhattacharyyaDistOfSubset::apply ( const std::list< int > &  in,
double &  dist 
) [virtual]

computes the bhattacharyya distance with the given subset of features

Parameters:
in std::list with the features that should be included for computing the function
dist the result of the cost function.
Returns:
true if apply successful or false otherwise.

Implements lti::costFunction.

virtual functor* lti::bhattacharyyaDistOfSubset::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

bhattacharyyaDistOfSubset& lti::bhattacharyyaDistOfSubset::copy ( const bhattacharyyaDistOfSubset other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::costFunction.

virtual const char* lti::bhattacharyyaDistOfSubset::getTypeName (  )  const [virtual]

returns the name of this type ("bhattacharyyaDistOfSubset")

Reimplemented from lti::costFunction.

bhattacharyyaDistOfSubset& lti::bhattacharyyaDistOfSubset::operator= ( const bhattacharyyaDistOfSubset other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::costFunction.

virtual void lti::bhattacharyyaDistOfSubset::setSrc ( const dmatrix src,
const ivector srcIds 
) [virtual]

Set the src data, that is used for the cost function.

This must be done before you call one of the apply methods. Later each feature can be adressed by its column number in this src matrix.

Reimplemented from lti::costFunction.


Member Data Documentation

Each element of the list contains all data points belonging to one cluster.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:26:45 2010 for LTI-Lib by Doxygen 1.6.1