k-means++ Initialisation

medium
Unit 8 · Clustering0/3 to milestone

k-means is sensitive to its starting centroids: pick badly and it converges to a poor solution. k-means++ spreads the initial centroids out:

Pro problem

Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.

Start 7-day free trial
solution.py · Python 3.13
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
k-means++ Initialisation · TechGradify