← All categories

Interview · flashcards
Unsupervised Learning
Clustering, dimensionality reduction, density estimation and anomaly detection.
easyclustering
How does k-means work and what are its main limitations?
Click, press Space or use the button below to reveal the answer
Interview-style answer
- 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).
Click again to flip back
1 / 214
Shortcuts: Space/Enter flip · ← / → navigate · K = known · R = review