20 #ifndef AGGLOMERATIVECLUSTERING_H 21 #define AGGLOMERATIVECLUSTERING_H 23 #include <mlpack/core.hpp> 41 AHCA(std::string linkage_method,
42 std::string metric_type);
45 void Link(
const arma::mat &data);
47 void SetLinkage(std::string linkage_method);
48 void SetMetric(std::string metric_type);
50 arma::mat Cluster(arma::uword k);
51 std::string metric_type();
52 std::string linkage_method();
53 arma::mat merge_data();
55 std::map<size_t, nodevec> clusters();
58 std::string metric_type_;
59 std::string linkage_method_;
60 arma::uword observations_;
61 arma::uvec FindClosest(
const arma::mat &data,
const arma::mat &dist,
62 const nodevec &clusters,
double &distance);
63 double ClusterDistance(
int i,
int j,
const arma::mat &data,
const arma::mat &dist,
66 arma::mat merge_data_;
67 arma::mat mean_distance_;
68 std::map<size_t, nodevec> clusters_;
73 std::string metric_type,
75 std::string shape =
"row");
81 #endif // AGGLOMERATIVECLUSTERING_H VESPUCCI_EXPORT arma::mat pdist(const arma::mat &x, std::string metric_type, arma::uword dim=1, std::string shape="row")
The AHCANode class This class stores a node in the data structure representing the AHCA dendrogram Th...
std::vector< node_t * > nodevec
Vespucci::Math::Clustering::AHCANode node_t
A namespace for "global" functions, including math functions.
The AHCA class Handles agglomerative hierarchical clustering of data This class holds a tree which re...