cr.sparse.cluster.vq.KMeansState

class cr.sparse.cluster.vq.KMeansState(centroids: jax._src.numpy.lax_numpy.ndarray, assignment: jax._src.numpy.lax_numpy.ndarray, 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