Skip to main content

Module cluster_index

Module cluster_index 

Source
Expand description

K-means clustering index: Lloyd’s algorithm, cluster assignment, centroid tracking, cluster statistics, merge, split, ANN search by cluster probing (v1.1.0 round 13) K-means clustering index for approximate nearest-neighbour search.

Features:

  • Lloyd’s algorithm with configurable k and maximum iterations
  • Cluster assignment (nearest centroid)
  • Centroid tracking (incremental updates as vectors are inserted)
  • Cluster statistics (size, intra-cluster variance, centroid drift)
  • Cluster merge (merge two closest clusters)
  • Cluster split (split the largest cluster)
  • ANN index search (probe nearest clusters for a query vector)

Structs§

ClusterIndex
K-means clustering index supporting ANN search by cluster probing.
ClusterStats
Runtime statistics for a single cluster.

Enums§

ClusterError
Errors produced by the cluster index.