Mini-batch K-means algorithm.