OpenMS
|
Base class for cluster functors. More...
#include <OpenMS/ML/CLUSTERING/ClusterFunctor.h>
Classes | |
class | InsufficientInput |
Exception thrown if not enough data (<2) is used. More... | |
Public Member Functions | |
ClusterFunctor () | |
default constructor More... | |
ClusterFunctor (const ClusterFunctor &source) | |
copy constructor More... | |
virtual | ~ClusterFunctor () |
destructor More... | |
ClusterFunctor & | operator= (const ClusterFunctor &source) |
assignment operator More... | |
virtual void | operator() (DistanceMatrix< float > &original_distance, std::vector< BinaryTreeNode > &cluster_tree, const float threshold=1) const =0 |
abstract for clustering the indices according to their respective element distances More... | |
Base class for cluster functors.
Each cluster functor employs a different method for stepwise merging clusters up to a given threshold, starting from the most elementary partition of data. Elements are represented by indices of a given distance matrix, which also should represent the order of input.
ClusterFunctor | ( | ) |
default constructor
ClusterFunctor | ( | const ClusterFunctor & | source | ) |
copy constructor
|
virtual |
destructor
|
pure virtual |
abstract for clustering the indices according to their respective element distances
original_distance | DistanceMatrix<float> containing the distances of the elements to be clustered, will be changed during clustering process, make sure to have a copy or be able to redo |
cluster_tree | vector< BinaryTreeNode >, represents the clustering, each node contains the next merged clusters (not element indices) and their distance, strict order is kept: left_child < right_child, |
threshold | float value, the minimal distance from which on cluster merging is considered unrealistic. By default set to 1, i.e. complete clustering until only one cluster remains |
original_distance
is considered mirrored at the main diagonal, so only entries up the main diagonal are used. The threshold
can be taken from the maximal distance of two elements considered related and adapted in a way corresponding to the employed clustering method. The results are represented by cluster_tree
, to get the actual clustering (with element indices) from a certain step of the clustering
Implemented in SingleLinkage, CompleteLinkage, and AverageLinkage.
ClusterFunctor& operator= | ( | const ClusterFunctor & | source | ) |
assignment operator