latest version v1.9 - last update 10 Apr 2010 |
Base class for all clustering methods that use centroids or prototypes for describing individual clusters. More...
#include <ltiCentroidClustering.h>
Public Member Functions | |
centroidClustering () | |
centroidClustering (const centroidClustering &other) | |
virtual | ~centroidClustering () |
virtual const char * | getTypeName () const |
centroidClustering & | copy (const centroidClustering &other) |
const parameters & | getParameters () const |
virtual bool | classify (const dvector &feature, outputVector &result) const |
const dmatrix & | getCentroids () const |
virtual bool | train (const dmatrix &input)=0 |
virtual bool | train (const dmatrix &input, ivector &ids) |
virtual bool | write (ioHandler &handler, const bool complete=true) const |
virtual bool | read (ioHandler &handler, const bool complete=true) |
Protected Attributes | |
dmatrix | centroids |
Base class for all clustering methods that use centroids or prototypes for describing individual clusters.
A classify(const dvector&) method is implemented that should work for most subclasses.
lti::centroidClustering::centroidClustering | ( | ) |
default constructor
lti::centroidClustering::centroidClustering | ( | const centroidClustering & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::centroidClustering::~centroidClustering | ( | ) | [virtual] |
destructor
virtual bool lti::centroidClustering::classify | ( | const dvector & | feature, | |
outputVector & | result | |||
) | const [virtual] |
classifies a new data point.
This method can be used by all centroid classifiers if they properly initialize the classifier::output member. I.e. for each output unit the list of probabilities may contain only one entry with probability one and each id may be used only once.
Since the classifier::output expects a probability vector as result from the clustering method, the dissimilarity measure usually returned must be converted to a similarity measure. Here, this is done by first normalizing the vector of dissimilarities, then subtracting this vector from a vector filled with ones and, finally, normalizing the result. This operation yields similarity values between zero and one for arbitrary scales of the feature space. Information about possible reject cases is lost through the first normalizaton, though.
feature | vector to be classified | |
result | result as described above |
Implements lti::unsupervisedClassifier.
centroidClustering& lti::centroidClustering::copy | ( | const centroidClustering & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::clustering.
Reimplemented in lti::adaptiveKMeans, lti::competitiveAgglomeration, lti::fuzzyCMeans, and lti::kMeansClustering.
const dmatrix& lti::centroidClustering::getCentroids | ( | ) | const |
Returns a const reference to the centroids of the clustering.
const parameters& lti::centroidClustering::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::clustering.
Reimplemented in lti::adaptiveKMeans, lti::competitiveAgglomeration, lti::fuzzyCMeans, and lti::kMeansClustering.
virtual const char* lti::centroidClustering::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("centroidClustering")
Reimplemented from lti::clustering.
Reimplemented in lti::adaptiveKMeans, lti::competitiveAgglomeration, lti::fuzzyCMeans, and lti::kMeansClustering.
virtual bool lti::centroidClustering::read | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | [virtual] |
read the rbf classifier from the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::classifier.
Calls clustering::train(const dmatrix&, ivector&).
Reimplemented from lti::clustering.
Reimplemented in lti::adaptiveKMeans, lti::competitiveAgglomeration, lti::fuzzyCMeans, and lti::kMeansClustering.
virtual bool lti::centroidClustering::train | ( | const dmatrix & | input | ) | [pure virtual] |
Declared so it wont be forgotten.
Implements lti::clustering.
Implemented in lti::adaptiveKMeans, lti::competitiveAgglomeration, lti::fuzzyCMeans, and lti::kMeansClustering.
virtual bool lti::centroidClustering::write | ( | ioHandler & | handler, | |
const bool | complete = true | |||
) | const [virtual] |
write the rbf classifier in the given ioHandler
handler | the ioHandler to be used | |
complete | if true (the default) the enclosing begin/end will be also written, otherwise only the data block will be written. |
Reimplemented from lti::classifier.
dmatrix lti::centroidClustering::centroids [protected] |
returns current parameters.
(non const! -> protected) matrix containing the centroids formed by the clustering method