nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
linkage.hpp
Go to the documentation of this file.
1
3// toolboxes/stats/include/nk/stats/cluster/linkage.hpp
4//
5// Agglomerative hierarchical clustering — linkage tree + flat-cluster
6// extraction. Function-form API only.
7
8#pragma once
9
10#include <memory_resource>
11#include <nk/value/value.hpp>
12
13#include <string>
14#include <tuple>
15
16namespace nk::stats {
17
20
21
39Value linkage(const Value &Y, const std::string &method,
40 std::pmr::memory_resource *mr = nullptr);
41
52Value linkage(const Value &Y, const std::string &method,
53 const std::string &metric, double p,
54 std::pmr::memory_resource *mr = nullptr);
55
67Value cluster_from_linkage(const Value &Z, int maxclust, double cutoff,
68 const std::string &criterion,
69 std::pmr::memory_resource *mr = nullptr);
70
82Value cluster_from_linkage(const Value &Z, int maxclust, double cutoff,
83 const std::string &criterion, int depth,
84 std::pmr::memory_resource *mr = nullptr);
85
95Value clusterdata(const Value &X, int maxclust, double cutoff,
96 const std::string &linkage_method,
97 const std::string &criterion,
98 std::pmr::memory_resource *mr = nullptr);
99
112Value clusterdata(const Value &X, int maxclust, double cutoff,
113 const std::string &linkage_method,
114 const std::string &criterion, int depth,
115 std::pmr::memory_resource *mr = nullptr);
116
131Value clusterdata(const Value &X, int maxclust, double cutoff,
132 const std::string &linkage_method,
133 const std::string &criterion, int depth,
134 const std::string &distance_metric, double p,
135 std::pmr::memory_resource *mr = nullptr);
136
148Value cophenet(const Value &Z, const Value &Y,
149 std::pmr::memory_resource *mr = nullptr);
150
164Value inconsistent(const Value &Z, int depth,
165 std::pmr::memory_resource *mr = nullptr);
166
167
169} // namespace nk::stats
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
Value linkage(const Value &Y, const std::string &method, std::pmr::memory_resource *mr=nullptr)
Agglomerative hierarchical clustering tree (Z = linkage(Y, method)).
Value clusterdata(const Value &X, int maxclust, double cutoff, const std::string &linkage_method, const std::string &criterion, std::pmr::memory_resource *mr=nullptr)
Convenience: pdist + linkage + cluster in one call (clusterdata).
Value inconsistent(const Value &Z, int depth, std::pmr::memory_resource *mr=nullptr)
Inconsistency coefficient table (R = inconsistent(Z, depth)).
Value cophenet(const Value &Z, const Value &Y, std::pmr::memory_resource *mr=nullptr)
Cophenetic correlation (c = cophenet(Z, Y)).
Value cluster_from_linkage(const Value &Z, int maxclust, double cutoff, const std::string &criterion, std::pmr::memory_resource *mr=nullptr)
Flatten a linkage tree into cluster labels (T = cluster(Z, opts)).