k-means clustering with k-means++ initialization and Lloyd iteration.
Runs at most maxIterations Lloyd passes and stops early once no centroid
shifts by more than tolerance Euclidean distance. Empty input or k <= 0
returns []. If k exceeds points.length, it is clamped down.
k-means clustering with k-means++ initialization and Lloyd iteration.
Runs at most
maxIterationsLloyd passes and stops early once no centroid shifts by more thantoleranceEuclidean distance. Empty input ork <= 0returns[]. Ifkexceedspoints.length, it is clamped down.