cr.sparse.cluster.vq.KMeansState

class cr.sparse.cluster.vq.KMeansState(centroids: jax.Array, assignment: jax.Array, distortion: float, prev_distortion: float, iterations: int)[source]

The state for K-means algorithm

Attributes

assignment

Current assignment of points to centroids

centroids

Current set of centroids

distortion

Current mean distance

iterations

The number of iterations it took to complete

prev_distortion

Previous mean distance