Vespucci
1.0.0
|
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, nodevec > | clusters () |
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.
Vespucci::Math::Clustering::AHCA::AHCA | ( | std::string | linkage_method, |
std::string | metric_type | ||
) |
Vespucci::Math::Clustering::AHCA::AHCATree.
linkage_method | |
metric_type | Valid 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.
arma::mat Vespucci::Math::Clustering::AHCA::Cluster | ( | arma::uword | k | ) |
Vespucci::Math::Clustering::AHCA::Cluster Generate cluster assignments from tree.
k | Number of clusters to find |
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.
data | Perform 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.
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.
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.