GClasses
GClasses::GClusterer Class Referenceabstract

Detailed Description

The base class for clustering algorithms. Classes that inherit from this class must implement a method named "cluster" which performs clustering, and a method named "whichCluster" which reports which cluster the specified row is determined to be a member of.

#include <GCluster.h>

Inheritance diagram for GClasses::GClusterer:
GClasses::GTransform GClasses::GAgglomerativeClusterer GClasses::GFuzzyKMeans GClasses::GKMeans GClasses::GKMedoids

Public Member Functions

 GClusterer (size_t nClusterCount)
 
virtual ~GClusterer ()
 
virtual void cluster (const GMatrix *pData)=0
 Performs clustering. More...
 
size_t clusterCount ()
 Return the number of clusters. More...
 
virtual GMatrixreduce (const GMatrix &in)
 Clusters pIn and outputs a dataset with one column that specifies the cluster number for each row. More...
 
void setMetric (GDistanceMetric *pMetric, bool own)
 If own is true, then this object will delete pMetric when it is destroyed. More...
 
virtual size_t whichCluster (size_t nVector)=0
 Reports which cluster the specified row is a member of. More...
 
- Public Member Functions inherited from GClasses::GTransform
 GTransform ()
 
 GTransform (const GDomNode *pNode)
 
virtual ~GTransform ()
 

Protected Attributes

size_t m_clusterCount
 
bool m_ownMetric
 
GDistanceMetricm_pMetric
 

Additional Inherited Members

- Protected Member Functions inherited from GClasses::GTransform
virtual GDomNodebaseDomNode (GDom *pDoc, const char *szClassName) const
 Child classes should use this in their implementation of serialize. More...
 

Constructor & Destructor Documentation

GClasses::GClusterer::GClusterer ( size_t  nClusterCount)
virtual GClasses::GClusterer::~GClusterer ( )
virtual

Member Function Documentation

virtual void GClasses::GClusterer::cluster ( const GMatrix pData)
pure virtual
size_t GClasses::GClusterer::clusterCount ( )
inline

Return the number of clusters.

virtual GMatrix* GClasses::GClusterer::reduce ( const GMatrix in)
inlinevirtual

Clusters pIn and outputs a dataset with one column that specifies the cluster number for each row.

Implements GClasses::GTransform.

void GClasses::GClusterer::setMetric ( GDistanceMetric pMetric,
bool  own 
)

If own is true, then this object will delete pMetric when it is destroyed.

virtual size_t GClasses::GClusterer::whichCluster ( size_t  nVector)
pure virtual

Reports which cluster the specified row is a member of.

Implemented in GClasses::GKMedoids, GClasses::GFuzzyKMeans, GClasses::GKMeans, and GClasses::GAgglomerativeClusterer.

Member Data Documentation

size_t GClasses::GClusterer::m_clusterCount
protected
bool GClasses::GClusterer::m_ownMetric
protected
GDistanceMetric* GClasses::GClusterer::m_pMetric
protected