Hierarchy
The Tree class contains the construction of the hierarchy in it’s constructors and class methods.
Tree Structure
Functions
-
struct Annotation
- #include <tree_structure.hpp>
Public Functions
-
inline Annotation(double cost_decrease, long long center, std::weak_ptr<Annotation> parent = std::weak_ptr<Annotation>(), std::weak_ptr<Node> tree_node = std::weak_ptr<Node>(), std::weak_ptr<Node> orig_node = std::weak_ptr<Node>(), long long level = 0)
-
inline bool operator<(const Annotation &other) const
-
inline bool operator>(const Annotation &other) const
-
inline Annotation(double cost_decrease, long long center, std::weak_ptr<Annotation> parent = std::weak_ptr<Annotation>(), std::weak_ptr<Node> tree_node = std::weak_ptr<Node>(), std::weak_ptr<Node> orig_node = std::weak_ptr<Node>(), long long level = 0)
-
struct Node : public std::enable_shared_from_this<Node>
- #include <tree_structure.hpp>
Public Members
-
long long id
-
double cost
-
long long k
-
unsigned long long size
-
bool is_cluster = false
-
long long low
-
long long high
-
std::shared_ptr<Annotation> anno
-
bool is_merger = false
-
std::vector<double> representative
-
long long k_marking = -1
-
double closest_center = std::numeric_limits<double>::infinity()
-
long long level
-
long long id
-
class Tree
- #include <tree_structure.hpp>
Public Functions
-
inline double cost_function(double value)
-
std::vector<std::vector<double>> get_distance_matrix()
-
std::string to_json(bool fast_index = false)
-
std::vector<long long> kcenter_cut(long long k)
-
std::vector<long long> kcenter_elbow_cut(bool triangle = true)
-
std::vector<long long> threshold_elbow_cut()
-
std::vector<long long> threshold_cut(long long k)
-
std::vector<long long> stability_cut(unsigned long long mcs)
-
std::vector<long long> normalized_stability_cut(unsigned long long mcs)
-
std::vector<long long> threshold_q_coverage(long long k, unsigned long long minPts, bool prune_stem = false, bool elbow = false, bool use_full_tree_elbow = false)
-
std::vector<long long> get_lca_prune_solution(bool triangle = true)
-
unsigned long long get_elbow_k(bool triangle = true)
Public Members
-
UltrametricTreeType tree_type
-
long long hierarchy
-
std::unordered_map<std::string, std::string> config
-
std::vector<long long> index_order
-
std::vector<std::shared_ptr<Annotation>> k_solutions
-
double max_cost
-
std::vector<double> costs
-
std::vector<double> cost_decreases
Private Functions
-
void setup_fast_index()
-
void compute_sorted_nodes()
-
void compute_sorted_costs()
-
void assign_nodes_their_k_values()
-
inline double sq_euclid_dist(std::vector<double> &p1, std::vector<double> &p2)
-
long long threshold(long long k = 0, bool stemTrim = false, bool force_kcenter_cut = false)
-
double stability(long long size, double pdist, double fallout_sum)
-
inline double cost_function(double value)