latest version v1.9 - last update 10 Apr 2010 |
This class implements a cost function for evaluating a subset of features based on the mahalanobis distance. More...
#include <ltiMahalanobisDistOfSubset.h>
Public Member Functions | |
mahalanobisDistOfSubset () | |
mahalanobisDistOfSubset (const mahalanobisDistOfSubset &other) | |
virtual | ~mahalanobisDistOfSubset () |
virtual const char * | getTypeName () const |
virtual void | setSrc (const dmatrix &src, const ivector &srcIds) |
virtual bool | apply (const std::list< int > &in, double &value) |
mahalanobisDistOfSubset & | copy (const mahalanobisDistOfSubset &other) |
mahalanobisDistOfSubset & | operator= (const mahalanobisDistOfSubset &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Protected Attributes | |
list< dmatrix > | clusters |
This class implements a cost function for evaluating a subset of features based on the mahalanobis distance.
A great value of this cost function shows well seperated clusters. First, for all points in the data set the mahalanobis distance to each cluster in distribution is computed. Then the result of this costFunction is the average of all these distances. Before you can compute the cost function use the setSrc method to pass the complete data set with all features to this class. Later the features are accessed only by their column number.
lti::mahalanobisDistOfSubset::mahalanobisDistOfSubset | ( | ) |
default constructor
lti::mahalanobisDistOfSubset::mahalanobisDistOfSubset | ( | const mahalanobisDistOfSubset & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::mahalanobisDistOfSubset::~mahalanobisDistOfSubset | ( | ) | [virtual] |
destructor
virtual bool lti::mahalanobisDistOfSubset::apply | ( | const std::list< int > & | in, | |
double & | value | |||
) | [virtual] |
computes the mahalanobis distance with the given subset of features
value | the result of the cost function. | |
in | std::list with the features that should be inclueded for computing the function |
Implements lti::costFunction.
virtual functor* lti::mahalanobisDistOfSubset::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
mahalanobisDistOfSubset& lti::mahalanobisDistOfSubset::copy | ( | const mahalanobisDistOfSubset & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::costFunction.
const parameters& lti::mahalanobisDistOfSubset::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
virtual const char* lti::mahalanobisDistOfSubset::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("mahalanobisDistOfSubset")
Reimplemented from lti::costFunction.
mahalanobisDistOfSubset& lti::mahalanobisDistOfSubset::operator= | ( | const mahalanobisDistOfSubset & | other | ) |
alias for copy member
other | the functor to be copied |
Reimplemented from lti::costFunction.
virtual void lti::mahalanobisDistOfSubset::setSrc | ( | const dmatrix & | src, | |
const ivector & | srcIds | |||
) | [virtual] |
Set the src data, that is used for computation.
This must be done before apply methods are called. Later each feature can be adressed by its column number, because usually a column represents a feature.
Reimplemented from lti::costFunction.
list<dmatrix> lti::mahalanobisDistOfSubset::clusters [protected] |
A list with each element containing a matrix with one cluster.
This list is build from the contructor.