GClasses
GClasses::GKMedoids Class Reference

Detailed Description

An implementation of the K-medoids clustering algorithm.

#include <GCluster.h>

Inheritance diagram for GClasses::GKMedoids:
GClasses::GClusterer GClasses::GTransform

Public Member Functions

 GKMedoids (size_t clusters)
 
virtual ~GKMedoids ()
 
virtual void cluster (const GMatrix *pData)
 Performs clustering. More...
 
virtual size_t whichCluster (size_t nVector)
 Identifies the cluster of the specified row. More...
 
- Public Member Functions inherited from GClasses::GClusterer
 GClusterer (size_t nClusterCount)
 
virtual ~GClusterer ()
 
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...
 
- Public Member Functions inherited from GClasses::GTransform
 GTransform ()
 
 GTransform (const GDomNode *pNode)
 
virtual ~GTransform ()
 

Protected Member Functions

double curErr (const GMatrix *pData)
 
- 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...
 

Protected Attributes

double m_d
 
const GMatrixm_pData
 
size_t * m_pMedoids
 
- Protected Attributes inherited from GClasses::GClusterer
size_t m_clusterCount
 
bool m_ownMetric
 
GDistanceMetricm_pMetric
 

Constructor & Destructor Documentation

GClasses::GKMedoids::GKMedoids ( size_t  clusters)
virtual GClasses::GKMedoids::~GKMedoids ( )
virtual

Member Function Documentation

virtual void GClasses::GKMedoids::cluster ( const GMatrix pData)
virtual

Performs clustering.

Implements GClasses::GClusterer.

double GClasses::GKMedoids::curErr ( const GMatrix pData)
protected
virtual size_t GClasses::GKMedoids::whichCluster ( size_t  nVector)
virtual

Identifies the cluster of the specified row.

Implements GClasses::GClusterer.

Member Data Documentation

double GClasses::GKMedoids::m_d
protected
const GMatrix* GClasses::GKMedoids::m_pData
protected
size_t* GClasses::GKMedoids::m_pMedoids
protected