kmeans
kmeans is a small and fast library for k-means clustering calculations. It requires a nightly compiler with the portable_simd feature to work.
Here is a small example, using kmean++ as initialization method and lloyd as k-means variant:
use *;
Datastructures
For performance-reasons, all calculations are done on bare vectors, using hand-written SIMD intrinsics from the packed_simd crate. All vectors are stored row-major, so each sample is stored in a consecutive block of memory.
Supported variants / algorithms
- lloyd (standard kmeans)
- minibatch
Supported centroid initialization methods
- KMean++
- random partition
- random sample
Supported distance functions
- Euclidean distance
- Histogram distance