Skip to content
Quantoros

How does K-Means clustering work, and what are its main limitations?

Classic MLLevel: IntermediateClassical machine learning

How does K-Means clustering work, and what are its main limitations?

Hints
  • How does this method define distance and cluster shape?
  • Consider noise, the number of groups and feature scaling.

Answer

K-Means randomly initializes k centroids, assigns each point to its nearest centroid, recomputes centroids as the mean of assigned points, and repeats until convergence (minimizing within-cluster sum of squares). Limitations: you must choose k in advance (use elbow method or silhouette score), it assumes roughly spherical, equally-sized clusters, it's sensitive to initialization (mitigated by k-means++), and it's sensitive to outliers and feature scale.

Follow-up: How would you choose k objectively rather than eyeballing an elbow plot?

Source and licence: Ishan Dutta — Awesome Data Science Interview Q&A · MIT

Related questions