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-Vassilvitskiik-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_samplesclassifier. Reports per-pointCore/Border/Noiseroles alongside the cluster label. - Hierarchical: [
AgglomerativeClustering] withSingle,Complete,Average, orWardlinkage. Uses the Lance-Williams update recurrence so the whole dendrogram is built inO(n² · log n)time withO(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 isO(n · k · d).k-means++pre-fit isO(n · k · d)in expectation and guarantees anO(log k)-competitive initial inertia (Arthur & Vassilvitskii 2007).DBSCAN: naive neighbour lookup isO(n²); usesolow-neighborsKDTreeexternally to obtainO(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.