solow-cluster 0.7.3

Rust unsupervised clustering for machine learning: k-means with k-means++, mini-batch k-means, bisecting k-means, DBSCAN, HDBSCAN, OPTICS, mean shift, affinity propagation, spectral clustering, agglomerative clustering with single, complete, average, and Ward linkage, Birch, Gaussian mixture, Bayesian Gaussian mixture.
Documentation

solow-cluster

Unsupervised clustering for the Solow statistical stack.

The crate ships three families that together cover the classical unsupervised-learning use cases:

  • Centroid-based: [KMeans] with the Arthur-Vassilvitskii k-means++ initialisation and Lloyd's iterative refinement. Deterministic under a caller-supplied seed via a portable MMIX-LCG PRNG.
  • Density-based: [Dbscan] — the Ester-Kriegel-Sander-Xu (KDD 1996) ε, min_samples classifier. Reports per-point Core / Border / Noise roles alongside the cluster label.
  • Hierarchical: [AgglomerativeClustering] with Single, Complete, Average, or Ward linkage. Uses the Lance-Williams update recurrence so the whole dendrogram is built in O(n² · log n) time with O(n²) space.

Every clusterer exposes the classical fit_predict(x) -> labels call, plus a richer typed result carrying centroids / linkage matrices / core-point flags when applicable. All types derive Serialize / Deserialize under the opt-in serde feature.

Convergence and complexity

  • KMeans: each Lloyd iteration is O(n · k · d). k-means++ pre-fit is O(n · k · d) in expectation and guarantees an O(log k)-competitive initial inertia (Arthur & Vassilvitskii 2007).
  • DBSCAN: naive neighbour lookup is O(n²); use solow-neighbors KDTree externally to obtain O(n log n) for low-dimensional data.
  • AgglomerativeClustering: O(n² · log n) time, O(n²) space via Müllner (2011) Modern hierarchical, agglomerative clustering algorithms.

Determinism

Every stochastic component (KMeans init, MiniBatchKMeans batch draws) uses a portable 64-bit MMIX linear-congruential generator seeded by the caller. Fits are bit-identical across runs and platforms given a fixed seed and input.