scikit-clarans
scikit-clarans implements the CLARANS (Clustering Large Applications based on RANdomized Search) and FastCLARANS algorithms for Python using the scikit-learn estimator interface.
Key characteristics:
Scikit-learn compatibility: estimators implement
fit,predict, andtransformas standard clusterers.Low memory footprint: computes distances dynamically with \(O(n)\) memory instead of allocating an \(O(n^2)\) pairwise matrix.
C acceleration: core swap evaluation runs in Cython with a pure Python fallback.
Flexible metrics: supports dense arrays via SciPy, sparse matrices via scikit-learn, and custom callables.
Note
This library is designed for coursework, algorithm study, and research prototyping. It scales well to tens of thousands of samples on a single machine, but it is not intended for distributed data systems.
Getting Started
API Reference
Example Gallery