#[non_exhaustive]pub struct Hdbscan { /* private fields */ }Expand description
HDBSCAN clustering model.
Automatically determines the number of clusters from density variations in the data. Noise points are labeled -1.
Implementations§
Source§impl Hdbscan
impl Hdbscan
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new HDBSCAN model with default parameters.
Default: min_cluster_size = 5, min_samples = min_cluster_size.
Sourcepub fn min_cluster_size(self, size: usize) -> Self
pub fn min_cluster_size(self, size: usize) -> Self
Set the minimum cluster size (default: 5).
Clusters with fewer points than this are dissolved into noise.
Sourcepub fn min_samples(self, k: usize) -> Self
pub fn min_samples(self, k: usize) -> Self
Set min_samples for core distance computation.
Default: same as min_cluster_size. Smaller values produce
more clusters; larger values make the algorithm more conservative.
Sourcepub fn metric(self, m: DistanceMetric) -> Self
pub fn metric(self, m: DistanceMetric) -> Self
Set the distance metric (default: DistanceMetric::Euclidean).
Use DistanceMetric::Cosine for L2-normalized embeddings
(e.g. face embeddings, CLIP vectors).
Sourcepub fn n_clusters(&self) -> usize
pub fn n_clusters(&self) -> usize
Number of clusters found (excluding noise).
Sourcepub fn outlier_scores(&self) -> &[f64]
pub fn outlier_scores(&self) -> &[f64]
Per-point outlier scores (higher = more outlier-like).
Based on the ratio of the point’s lambda value to its cluster’s lambda birth. Points deep inside clusters have scores near 0; borderline points have scores near 1.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more