Machine Learning Library
|
Base class for cluster algorithms. More...
#include <CClusterAlgorithm.h>
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) |
![]() | |
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 |
![]() | |
unsigned char | ucVerbose |
Base class for cluster algorithms.
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.
|
virtual |
Destructor
CDataset<Type> CClusterAlgorithm< Type >::getReferenceVectors | ( | ) | const |
Return reference vectors as a dataset
int CClusterAlgorithm< Type >::nearestNode | ( | const CVector< Type > & | rtPattern | ) | const |
Return index of nearest node
Type CClusterAlgorithm< Type >::nearestNodeDistance | ( | const CVector< Type > & | rtPattern | ) | const |
Return distance to nearest node
CDataset<Type>& CClusterAlgorithm< Type >::referenceVectors | ( | ) |
Return reference to reference vectors as a dataset
Type CClusterAlgorithm< Type >::rmse | ( | const CDataset< Type > & | tDataset | ) | const |
Calculate Root-Mean-Square-Error on given dataset
tDataset | Reference to dataset |
|
virtual |
Read/write object to binary stream
stream | Binary stream |
mode | READ or WRITE |
Reimplemented from CObject< 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.
ptMetric | Pointer to new metric object |
|
pure virtual |
|
protected |
Metric
|
protected |
Dataset with reference vectors of clusters