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

lti::adaptiveKMeans Class Reference

this class implements a k-means clustering that determines the number of clusters by itself More...

#include <ltiAdaptiveKMeans.h>

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

List of all members.

Classes

class  parameters
 the parameters for the class adaptiveKMeans More...

Public Member Functions

 adaptiveKMeans ()
 adaptiveKMeans (const adaptiveKMeans &other)
virtual ~adaptiveKMeans ()
virtual const char * getTypeName () const
adaptiveKMeanscopy (const adaptiveKMeans &other)
adaptiveKMeansoperator= (const adaptiveKMeans &other)
virtual classifierclone () const
const parametersgetParameters () const
virtual bool train (const dmatrix &input, ivector &ids)
virtual bool train (const dmatrix &input)

Detailed Description

this class implements a k-means clustering that determines the number of clusters by itself

The algorithm is based on Kothari R., Pitts D., 1998. On finding the number of clusters. Pattern Recognition Letters 20, 405-416.

The algorithm determines the number of cluster in the given data and performs a k means clustering the the detected number of clusters on it. When the algorithm is executed, is does a lot of k means clusterings, with an additional term that brings the cluster centers together. Clusters that have too few points are deleted and clusters that are two close to each other are combined, according to the actual neighborhood. The neighborhood is varied between the values of the parameters minNeighborhood and maxNeighborhood, in as many steps as parameter nbNeighborhoods. If parameter detectNeighborhood is true, the paramters minNeighborhood and maxNeighborhood are set by the algorithm.The Parameter minNumberOfPoints is the minimal number of points that must belong to a cluster, otherwise the cluster will be deleted. maxIterations is the maximum number of Iterations before the clusters are viewed to be stable. maxDistance is the maximal distance that each component of the centroids can move before they are viewed as stable. If every component moves in one iteration less than this parameter, the centroids are set to be stable. The Parameter nbClusters is the number of clusters the algorithm starts with. It has to be bigger than the real number clusters. If the learnRate is too big, so that the centroids don't converge, the algorithm halves the learn rate, restarts and sets a statusString.


Constructor & Destructor Documentation

lti::adaptiveKMeans::adaptiveKMeans (  ) 

default constructor

lti::adaptiveKMeans::adaptiveKMeans ( const adaptiveKMeans other  ) 

copy constructor

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

destructor


Member Function Documentation

virtual classifier* lti::adaptiveKMeans::clone (  )  const [virtual]

returns a pointer to a clone of this clustering.

Implements lti::classifier.

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

copy data of "other" clustering.

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

Reimplemented from lti::centroidClustering.

const parameters& lti::adaptiveKMeans::getParameters (  )  const

returns used parameters

Reimplemented from lti::centroidClustering.

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

returns the name of this type ("adaptiveKMeans")

Reimplemented from lti::centroidClustering.

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

alias for copy member

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

Reimplemented from lti::classifier.

virtual bool lti::adaptiveKMeans::train ( const dmatrix input  )  [virtual]

Unsupervised training.

The vectors in the input matrix will be clustered using each specific method.

Parameters:
input the matrix with the input vectors (each row is a training vector)
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Implements lti::centroidClustering.

virtual bool lti::adaptiveKMeans::train ( const dmatrix input,
ivector ids 
) [virtual]

Unsupervised training.

The vectors in the input matrix will be put into groups according to the training algorithm. Additionally, an integer indicating the class each point belongs to is returned.

By default this method uses the other train method and then calls classify(const dvector&) to get the ids for each trainvector. These ids are then returned.

Parameters:
input the matrix with the input vectors (each row is a training vector)
ids vector of class ids for each input point
Returns:
true if successful, false otherwise. (if false you can check the error message with getStatusString())

Reimplemented from lti::centroidClustering.


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