How does k-means work and what are its main limitations?
easyAnswer
- Initialize k centroids (k-means++ is best).
- Assign each point to the nearest centroid, then recompute centroids as the mean of assigned points; repeat until convergence.
- Limitations: you must choose k, it assumes spherical clusters of similar size, it's sensitive to scale and outliers, and it can get stuck in local minima (mitigated by multiple restarts).
Check yourself — multiple choice
- k-means always finds the global optimum
- k-means assumes elongated, differently-sized clusters
- k-means assumes spherical, similarly-sized clusters
- k-means does not need k as input
k-means implicitly assumes convex, isotropic clusters of similar variance.
#clustering
Practise Unsupervised Learning
214 interview questions in this topic.