1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! # ferrolearn-cluster
//!
//! Clustering algorithms for the ferrolearn machine learning framework.
//!
//! This crate provides unsupervised clustering methods:
//!
//! - **[`KMeans`]** — K-Means clustering with k-Means++ initialization
//! and parallelized assignment via Rayon (REQ-6).
//! - **[`DBSCAN`]** — Density-Based Spatial Clustering of Applications
//! with Noise (REQ-7).
//! - **[`GaussianMixture`]** — Gaussian Mixture Models via the
//! Expectation-Maximisation algorithm, with four covariance types
//! (full, tied, diagonal, spherical) (REQ-3).
//! - **[`AgglomerativeClustering`]** — Bottom-up hierarchical clustering
//! with Ward, Complete, Average, and Single linkage (REQ-5).
//! - **[`MeanShift`]** — Non-parametric mode-seeking clustering (REQ-23).
//! - **[`SpectralClustering`]** — Graph Laplacian eigenmap clustering (REQ-23).
//! - **[`OPTICS`]** — Ordering Points To Identify the Clustering Structure (REQ-23).
//!
//! # Design
//!
//! All algorithms follow the compile-time safety pattern:
//!
//! - The unfitted config struct implements [`Fit`](ferrolearn_core::Fit)
//! with `Y = ()` (unsupervised).
//! - [`KMeans`] produces [`FittedKMeans`], which implements
//! [`Predict`](ferrolearn_core::Predict) (assign to nearest centroid)
//! and [`Transform`](ferrolearn_core::Transform) (distance to each centroid).
//! - [`DBSCAN`] produces [`FittedDBSCAN`], which only stores labels and
//! core sample indices — it does **not** implement `Predict`.
//! - [`GaussianMixture`] produces [`FittedGaussianMixture`], which
//! implements [`Predict`](ferrolearn_core::Predict) (hard assignment) and
//! [`Transform`](ferrolearn_core::Transform) (soft responsibilities).
//! - [`AgglomerativeClustering`] produces [`FittedAgglomerativeClustering`],
//! which stores labels and the merge tree — it does **not** implement
//! `Predict`.
//! - [`MeanShift`] produces [`FittedMeanShift`], which implements
//! [`Predict`](ferrolearn_core::Predict) (assign to nearest center).
//! - [`SpectralClustering`] produces [`FittedSpectralClustering`], which stores
//! labels — it does **not** implement `Predict`.
//! - [`OPTICS`] produces [`FittedOPTICS`], which stores the reachability
//! ordering and distances — it does **not** implement `Predict`.
//!
//! # Float Generics
//!
//! All algorithms are generic over `F: num_traits::Float + Send + Sync + 'static`,
//! supporting both `f32` and `f64`.
// Re-export the main types at the crate root.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;