Machine Learning Library
Public Member Functions | Protected Attributes | List of all members
CClusterAlgorithm< Type > Class Template Referenceabstract

Base class for cluster algorithms. More...

#include <CClusterAlgorithm.h>

Inheritance diagram for CClusterAlgorithm< Type >:
CObject< Type > CSOM< Type >

Public Member Functions

 CClusterAlgorithm (CMetric< Type > *ptMetric=new CEuclideanMetric< Type >())
 
virtual ~CClusterAlgorithm ()
 
void setMetric (CMetric< Type > *ptMetric)
 
CDataset< Type > getReferenceVectors () const
 
CDataset< Type > & referenceVectors ()
 
virtual void train (CDataset< Type > &tDataset)=0
 
Type rmse (const CDataset< Type > &tDataset) const
 
int nearestNode (const CVector< Type > &rtPattern) const
 
Type nearestNodeDistance (const CVector< Type > &rtPattern) const
 
bool serialize (fstream &stream, IO_MODE mode)
 
- Public Member Functions inherited from CObject< Type >
 CObject ()
 Constructor. More...
 
virtual ~CObject ()
 Destructor. More...
 
virtual bool serialize2 (CArchiv &tArchiv)
 
virtual string className () const
 Returns the class name. More...
 
void setVerbose (VERBOSE_LEVEL tVerbose)
 Set the verbose level. More...
 
VERBOSE_LEVEL verbose (void) const
 Return current verbose level. More...
 
virtual bool isA (const char *acClass) const
 Check if the object is an instance of the class with given name. More...
 
DATATYPE dataType () const
 Returns the template data type. More...
 

Protected Attributes

CDataset< Type > tReferenceVectors
 
CMetric< Type > * ptMetric
 
- Protected Attributes inherited from CObject< Type >
unsigned char ucVerbose
 

Detailed Description

template<class Type>
class CClusterAlgorithm< Type >

Base class for cluster algorithms.

Author
Thorsten Twellmann

Constructor & Destructor Documentation

template<class Type >
CClusterAlgorithm< Type >::CClusterAlgorithm ( CMetric< Type > *  ptMetric = new CEuclideanMetric< Type >())

Construct new cluster object that uses the given metric. The algorithm becomes the owner of the metric object and will delete it on destruction.

template<class Type >
virtual CClusterAlgorithm< Type >::~CClusterAlgorithm ( )
virtual

Destructor

Member Function Documentation

template<class Type >
CDataset<Type> CClusterAlgorithm< Type >::getReferenceVectors ( ) const

Return reference vectors as a dataset

Returns
Dataset of reference vectors
template<class Type >
int CClusterAlgorithm< Type >::nearestNode ( const CVector< Type > &  rtPattern) const

Return index of nearest node

template<class Type >
Type CClusterAlgorithm< Type >::nearestNodeDistance ( const CVector< Type > &  rtPattern) const

Return distance to nearest node

template<class Type >
CDataset<Type>& CClusterAlgorithm< Type >::referenceVectors ( )

Return reference to reference vectors as a dataset

Returns
reference to Dataset of reference vectors
template<class Type >
Type CClusterAlgorithm< Type >::rmse ( const CDataset< Type > &  tDataset) const

Calculate Root-Mean-Square-Error on given dataset

Parameters
tDatasetReference to dataset
Returns
RMSE
template<class Type >
bool CClusterAlgorithm< Type >::serialize ( fstream &  stream,
IO_MODE  mode 
)
virtual

Read/write object to binary stream

Parameters
streamBinary stream
modeREAD or WRITE
Returns
False on error

Reimplemented from CObject< Type >.

template<class Type >
void CClusterAlgorithm< Type >::setMetric ( CMetric< Type > *  ptMetric)

Set metric object to use. The algorithm becomes the owner of the metric object and will delete it.

Parameters
ptMetricPointer to new metric object
template<class Type >
virtual void CClusterAlgorithm< Type >::train ( CDataset< Type > &  tDataset)
pure virtual

Cluster given dataset

Parameters
tDatasetReference to dataset

Implemented in CSOM< Type >.

Member Data Documentation

template<class Type >
CMetric<Type>* CClusterAlgorithm< Type >::ptMetric
protected

Metric

template<class Type >
CDataset<Type> CClusterAlgorithm< Type >::tReferenceVectors
protected

Dataset with reference vectors of clusters


The documentation for this class was generated from the following file: