How do you use a k-distance graph to select the eps parameter for DBSCAN?

Quick Overview

Explains how to choose the eps radius for DBSCAN from a sorted k-distance plot. Tests understanding of core points, how k relates to min_samples, how to read the curve, and what goes wrong with unscaled features or clusters of different density.

How do you use a k-distance graph to select the eps parameter for DBSCAN?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How do you use a k-distance graph to select the `eps` parameter for DBSCAN? ```hint Start from the core point rule DBSCAN calls a point a core point when enough neighbors fall within `eps`. Think about what that rule says about each point's distance to its `min_samples`-th neighbor. ``` ### What a Strong Answer Covers - How the k-distance of each point is computed and how k relates to `min_samples` - How the sorted curve is read and where on it `eps` is taken - Why that value separates core points from noise - Practical pitfalls: feature scaling, the self-neighbor off-by-one in library calls, the subjective knee, and clusters of different density ### Follow-up Questions - How would you choose `min_samples` before drawing the plot? - The plot shows two distinct knees. What does that tell you, and what would you do? - How does HDBSCAN avoid choosing `eps` at all? - What happens to the k-distance curve in very high-dimensional data?

Overview: Explains how to choose the eps radius for DBSCAN from a sorted k-distance plot. Tests understanding of core points, how k relates to min_samples, how to read the curve, and what goes wrong with unscaled features or clusters of different density.

PracHub logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How do you use a k-distance graph to select the eps parameter for DBSCAN?

What a Strong Answer Covers Guidance

  • How the k-distance of each point is computed and how k relates to min_samples
  • How the sorted curve is read and where on it eps is taken
  • Why that value separates core points from noise
  • Practical pitfalls: feature scaling, the self-neighbor off-by-one in library calls, the subjective knee, and clusters of different density

Follow-up Questions Guidance

  • How would you choose min_samples before drawing the plot?
  • The plot shows two distinct knees. What does that tell you, and what would you do?
  • How does HDBSCAN avoid choosing eps at all?
  • What happens to the k-distance curve in very high-dimensional data?