latest version v1.9 - last update 10 Apr 2010 |
The class implements the bhattacharyya distance as cost function. More...
#include <ltiBhattacharyyaDistOfSubset.h>
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) |
bhattacharyyaDistOfSubset & | copy (const bhattacharyyaDistOfSubset &other) |
bhattacharyyaDistOfSubset & | operator= (const bhattacharyyaDistOfSubset &other) |
virtual functor * | clone () const |
Protected Attributes | |
std::list< dmatrix > | clusters |
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.
lti::bhattacharyyaDistOfSubset::bhattacharyyaDistOfSubset | ( | ) |
default constructor
lti::bhattacharyyaDistOfSubset::bhattacharyyaDistOfSubset | ( | const bhattacharyyaDistOfSubset & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::bhattacharyyaDistOfSubset::~bhattacharyyaDistOfSubset | ( | ) | [virtual] |
destructor
virtual bool lti::bhattacharyyaDistOfSubset::apply | ( | const std::list< int > & | in, | |
double & | dist | |||
) | [virtual] |
computes the bhattacharyya distance with the given subset of features
in | std::list with the features that should be included for computing the function | |
dist | the result of the cost function. |
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.
other | the functor to be copied |
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
other | the functor to be copied |
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.
std::list<dmatrix> lti::bhattacharyyaDistOfSubset::clusters [protected] |
Each element of the list contains all data points belonging to one cluster.