Mini-batch K-means
The first approach we are going to consider is a mini-batch version of the standard K-means algorithm. In this case, we cannot compute the centroids for all samples, and so the main problem is to define a criterion to reassign the centroids after a partial fit. The standard process is based on a streaming average, and therefore there will be centroids with a higher sample count and others with lower values. In scikit-learn, the fine-tuning of this process is achieved using the reassigment_ratio parameter (whose default value is 0.01). Small values (for example, 0.0001) will let the centroids whose clusters have a fewer number of samples to the same value for a longer time, yielding a sub-optimal but faster solution. On ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access