Vespucci  1.0.0
Vespucci::Math::Clustering::AHCA Class Reference

The AHCA class Handles agglomerative hierarchical clustering of data This class holds a tree which represents the clustering dendrogram. More...

#include <agglomerativeclustering.h>

Public Member Functions

 AHCA (std::string linkage_method, std::string metric_type)
 Vespucci::Math::Clustering::AHCA::AHCATree. More...
 
 AHCA ()
 
void Link (const arma::mat &data)
 Vespucci::Math::Clustering::AHCA::Link. More...
 
void SetLinkage (std::string linkage_method)
 
void SetMetric (std::string metric_type)
 
arma::mat Cluster (arma::uword k)
 Vespucci::Math::Clustering::AHCA::Cluster Generate cluster assignments from tree. More...
 
std::string metric_type ()
 Vespucci::Math::Clustering::AHCA::metric_type. More...
 
std::string linkage_method ()
 Vespucci::Math::Clustering::AHCA::linkage_method. More...
 
arma::mat merge_data ()
 
arma::mat dist ()
 
std::map< size_t, nodevecclusters ()
 

Detailed Description

The AHCA class Handles agglomerative hierarchical clustering of data This class holds a tree which represents the clustering dendrogram.

Definition at line 38 of file agglomerativeclustering.h.

Constructor & Destructor Documentation

Vespucci::Math::Clustering::AHCA::AHCA ( std::string  linkage_method,
std::string  metric_type 
)

Vespucci::Math::Clustering::AHCA::AHCATree.

Parameters
linkage_method
metric_typeValid parameters: linkage_method: "average" - average distance "centroid" - centroid distance should only be used with 'squaredeuclidean' or 'euclidean' distance metric "ward" - inner squared distance, should only be used with euclidean distance metrics "complete" - greatest distance between points "single" - least distance between points metric_type: "euclidean" "squaredeuclidean" "manhattan" "chebyshev" "cosine" "correlation"

This will throw std::invalid_argument if invalid linkage or metric provided If "ward" is selected as linkage method, the metric_type argument is ignored. Squared euclidean distance will be used.

If "ward" is seleced, the distance between steps is stored as the variance of the cluster.

Definition at line 49 of file agglomerativeclustering.cpp.

Vespucci::Math::Clustering::AHCA::AHCA ( )

Definition at line 72 of file agglomerativeclustering.cpp.

Member Function Documentation

arma::mat Vespucci::Math::Clustering::AHCA::Cluster ( arma::uword  k)

Vespucci::Math::Clustering::AHCA::Cluster Generate cluster assignments from tree.

Parameters
kNumber of clusters to find
Returns
matrix with assignments in columns The linkage process will be repeated, but at a higher tree level with precalculated distances.

Definition at line 161 of file agglomerativeclustering.cpp.

std::map< size_t, nodevec > Vespucci::Math::Clustering::AHCA::clusters ( )

Definition at line 209 of file agglomerativeclustering.cpp.

arma::mat Vespucci::Math::Clustering::AHCA::dist ( )

Definition at line 204 of file agglomerativeclustering.cpp.

void Vespucci::Math::Clustering::AHCA::Link ( const arma::mat &  data)

Vespucci::Math::Clustering::AHCA::Link.

Parameters
dataPerform the linkage to build the AHCA tree

Definition at line 81 of file agglomerativeclustering.cpp.

std::string Vespucci::Math::Clustering::AHCA::linkage_method ( )

Vespucci::Math::Clustering::AHCA::linkage_method.

Returns
Access to name of linkage method

Definition at line 194 of file agglomerativeclustering.cpp.

arma::mat Vespucci::Math::Clustering::AHCA::merge_data ( )

Definition at line 199 of file agglomerativeclustering.cpp.

std::string Vespucci::Math::Clustering::AHCA::metric_type ( )

Vespucci::Math::Clustering::AHCA::metric_type.

Returns
Access to name of metric

Definition at line 185 of file agglomerativeclustering.cpp.

void Vespucci::Math::Clustering::AHCA::SetLinkage ( std::string  linkage_method)

Definition at line 128 of file agglomerativeclustering.cpp.

void Vespucci::Math::Clustering::AHCA::SetMetric ( std::string  metric_type)

Definition at line 140 of file agglomerativeclustering.cpp.


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