Why do you scale features before k-means?
easyAnswer
- Euclidean distance is scale-sensitive: a feature with 1000-range dominates one with 0-1 range.
- Standardize (z-score) so features contribute equally.
- Exception: if scale carries meaning (spatial coordinates in meters), don't scale.
- Also: outliers stretch scale → robust scaling (median / IQR) can be better.
- Missing this is one of the most common bugs in first-time clustering pipelines.
Check yourself — multiple choice
- Never scale
- Distance is scale-sensitive → z-score so features contribute equally; robust scaling for outliers; keep raw scale only if it's meaningful
- Same as PCA
- Random
k-means Euclidean is scale-sensitive → standardize features by default.
#clustering#similarity
Practise Unsupervised Learning
214 interview questions in this topic.
Related questions
- How do you cluster mixed numeric + categorical data?
- Cosine similarity vs Euclidean — when do you use cosine?
- What is Dynamic Time Warping?
- You run k-means on customer data with age, income and number of purchases. What breaks?
- How does k-means work and what are its main limitations?
- How do you choose the number of clusters k?