In mini-batch k-means (Sculley's version) each centre has a count of points it has absorbed. For each point assigned to it, the update is , with . In 1-D the centres are with and with . A mini-batch arrives. What are the new centres, and why does this update make sense?
Unsupervised learning, Mini-batch k-means
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can apply the per-centre learning rate and see that it keeps a running average.
Key idea
With the update is exactly the incremental formula for the mean of all points seen by that centre. So the learning rate decays like and the centres settle down.
Steps
- Assign each batch point to its nearest centre first. The point 6 is at distance 2 from and 4 from , so it goes to centre 1. The point 2 goes to centre 1 (distance 2 against 8). The point 9 goes to centre 2 (distance 1 against 5), and 12 goes to centre 2.
- Centre 1, point 6: , , .
- Centre 1, point 2: , , .
- Centre 2, point 9: , , . Then point 12: , , .
- Check with means. Centre 1 has absorbed three old points averaging 4, plus 6 and 2, so its mean is . Centre 2 has . The updates match.
- Explain why it is useful: each iteration touches only a small batch, so the cost per step is instead of . The rate averages out noise from the random batches.
Common mistakes
- Using a fixed learning rate for every centre. Then early centres are noisy and busy centres are not averaged properly.
- Recomputing the assignment after each single update inside the batch. In Sculley's algorithm the batch is assigned first, then the centres are updated.
- Expecting the same answer as full k-means. Mini-batch gives a slightly higher objective in exchange for speed.
How long your answer should be
About 5 short lines of arithmetic plus two sentences of explanation.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: Six records have three categorical attributes: , , , , , . Run k-modes with from initial modes and , using the simple matching dissimilarity. What are the clusters, the new modes and the total cost?
Next in Unsupervised learning: Take the 1-D points with and absolute-difference distance. Starting from medoids , compute the total cost, then the cost after swapping medoid 1 with the non-medoid 2. Does PAM accept the swap, and is optimal?