Why must features be scaled before running k-means or DBSCAN?

Quick Overview

Asks why features need scaling before k-means or DBSCAN clustering and what goes wrong when they keep their raw units. Tests understanding of distance-based objectives, the DBSCAN eps radius, common scalers and how scaling acts as a choice of feature weights.

Why must features be scaled before running k-means or DBSCAN?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

Why must features be scaled before running k-means or DBSCAN? Explain what goes wrong when the features are left in their raw units, how it affects each algorithm, and which scaling you would pick. ```hint Write out the distance Take two features measured in very different units and write out the Euclidean distance between two points. See which term decides the result. ``` ### What a Strong Answer Covers - Why both algorithms depend on raw distances and what a large-range feature does to them - How the problem shows up in the k-means objective - Why a single DBSCAN radius cannot fit unscaled features - The common scalers and when each one fits the data - That scaling is itself a choice of feature weights ### Follow-up Questions - When would you deliberately leave features unscaled, or give one feature more weight? - After scaling, how would you choose `eps` for DBSCAN? - Which common models do not need feature scaling, and why? - How would you cluster data that mixes continuous features with one-hot categorical columns?

Overview: Asks why features need scaling before k-means or DBSCAN clustering and what goes wrong when they keep their raw units. Tests understanding of distance-based objectives, the DBSCAN eps radius, common scalers and how scaling acts as a choice of feature weights.

PracHub logo
General
Nov 24, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

Why must features be scaled before running k-means or DBSCAN?

Explain what goes wrong when the features are left in their raw units, how it affects each algorithm, and which scaling you would pick.

What a Strong Answer Covers Guidance

  • Why both algorithms depend on raw distances and what a large-range feature does to them
  • How the problem shows up in the k-means objective
  • Why a single DBSCAN radius cannot fit unscaled features
  • The common scalers and when each one fits the data
  • That scaling is itself a choice of feature weights

Follow-up Questions Guidance

  • When would you deliberately leave features unscaled, or give one feature more weight?
  • After scaling, how would you choose eps for DBSCAN?
  • Which common models do not need feature scaling, and why?
  • How would you cluster data that mixes continuous features with one-hot categorical columns?