pub struct Hdbscan { /* private fields */ }Expand description
Hierarchical DBSCAN (Campello, Moulavi and Sander). Instead of one density threshold eps it
considers all of them at once:
- the mutual reachability distance
max(core(a), core(b), d(a, b))(withcorethe distance to themin_samples-th nearest neighbour) spreads sparse points apart; - a minimum spanning tree of that metric gives the single-linkage hierarchy;
- the hierarchy is condensed: a split only counts if both parts have at least
min_cluster_sizepoints, smaller pieces are just points falling out of their cluster; - each condensed cluster’s stability
Σ (λ_leave - λ_birth)(withλ = 1/distance) measures how long and how densely it persists, and the set of non-overlapping clusters with the greatest total stability is chosen (“excess of mass”).
The result finds clusters of different densities without choosing eps, and labels the rest as
noise (None). The implementation uses the dense O(n²) distance matrix.
Implementations§
Source§impl Hdbscan
impl Hdbscan
pub fn new(min_cluster_size: usize) -> Self
Sourcepub fn with_min_samples(self, min_samples: usize) -> Self
pub fn with_min_samples(self, min_samples: usize) -> Self
Sets min_samples, the neighbour count defining local density (default: min_cluster_size);
larger values make the result more conservative about calling points part of clusters.
Sourcepub fn cluster_stabilities(&self) -> &[f64]
pub fn cluster_stabilities(&self) -> &[f64]
The stability of each selected cluster, in label order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hdbscan
impl RefUnwindSafe for Hdbscan
impl Send for Hdbscan
impl Sync for Hdbscan
impl Unpin for Hdbscan
impl UnsafeUnpin for Hdbscan
impl UnwindSafe for Hdbscan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more