← Back to Classic ML Mind Map
📊 Classic MLID: dbscan-hierarchical

DBSCAN & Hierarchical Clustering

DBSCAN 与层次聚类
🎯Core Definition
DBSCAN is a density-based clustering algorithm that needs no preset cluster count KK — only two parameters, ε and minPts. The ε-neighborhood is Nε(p)={q∈D∣dist(p,q)≤ε}N_\varepsilon(p) = \{ q \in D \mid \text{dist}(p, q) \le \varepsilon \}; a core point satisfies ∣Nε(p)∣≥minPts|N_\varepsilon(p)| \ge \text{minPts}, a border point is non-core but inside some core point's ε-neighborhood, and noise points are neither.Density directly reachable: pp is a core point and q∈Nε(p)q \in N_\varepsilon(p); density reachable: a chain of core points p1,…,pmp_1, \ldots, p_m with consecutive direct reachability; density connected: some oo exists from which both pp and qq are density reachable. A cluster is a maximal set of density-connected points; noise is flagged explicitly. Complexity is O(nlog⁡n)O(n \log n) with a KD-Tree or naive O(n2)O(n^2).Hierarchical clustering (AGNES) merges the closest clusters bottom-up using linkages — single (nearest-point distance, prone to chaining), complete (farthest-point distance, noise-robust), Ward (minimum variance increase, most common); naive complexity O(n3)O(n^3).
💡Use Cases
geo-spatial clustering, image segmentation, anomaly detection (noise points are outliers), and arbitrarily shaped clusters; interviews compare it with K-Means and ask about ε/minPts tuning.
⚡Key Problems Solved
K-Means needs K, assumes convex clusters, and forces noise into clusters; DBSCAN needs no K, finds arbitrary shapes, and separates noise automatically. The cost: ε is hard to set globally for uneven density (minPts ≈ 2×dimensions is a common heuristic) and neighborhood counting degrades in high dimensions (curse of dimensionality); hierarchical clustering keeps an O(n2)O(n^2) distance matrix, unfit for large data.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of DBSCAN & Hierarchical Clustering.
Use Cases
In production engineering, what are the primary use cases for DBSCAN & Hierarchical Clustering and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Define core, border, and noise points in DBSCAN; how do larger/smaller ε and minPts change the clustering?
2
Distinguish density-reachable from density-connected; why is reachability asymmetric while connectedness is symmetric?
3
Core differences between DBSCAN and K-Means; which data shapes suit each; why does DBSCAN fail on uneven density?
4
Single, complete, and Ward linkage criteria in hierarchical clustering; what is the chaining effect?
5
Time complexity of DBSCAN and index acceleration; why is ε hard to choose in high dimensions?
📖 In-depth Guide:📄 clustering-and-knn →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "DBSCAN & Hierarchical Clustering"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardK-Means++ & K SelectionNext Card →EM Algorithm

🔗 More Classic ML Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/ML/card/dbscan-hierarchical
中文速览与面试要点

DBSCAN 与层次聚类 (DBSCAN & Hierarchical Clustering)

定义: DBSCAN 是基于密度的聚类算法, 不需预设簇数 K, 只需 ε 与 minPts 两个参数。ε-邻域 N_ (p) = \ q D dist(p, q) \; 核心点: |N_ (p)| minPts; 边界点: 非核心但在某核心点的 ε-邻域内; 噪声点: 两者皆非。密度直达: p 为核心点且 q N_ (p); 密度可达: 存在核心点链 p_1, , p_m 使相邻两点密度直达; 密度相连: 存在 o 使 p、q 均从 o 密度可达。簇 = 密度相连的最大点集, 噪声点被显式标出。复杂度 O(n n) (KD-Tree 加速) 或朴素 O(n^2)。层次聚类 (AGNES): 自底向上合并最近簇, 连接准则——单链接 (最近点距离, 易链式效应)、全链接 (最远点距离, 抗噪声)、Ward (合并后方差增量最小, 最常用), 朴素复杂度 O(n^3)。 使用场景: 地理空间聚类、图像分割、异常检测 (噪声点即离群点)、形状不规则的簇; 面试常考与 K-Means 的对比和 ε/minPts 调参。 解决的问题: K-Means 需预设 K、只认凸形簇且把噪声硬拉进簇; DBSCAN 无需 K, 可发现任意形状簇并自动分离噪声。代价是 ε 对密度不均的数据难以全局设定 (minPts ≈ 2×维度 是常用启发式), 高维下邻域计数退化 (维度灾难), 层次聚类则需维护 O(n^2) 距离矩阵, 不适合大样本。

核心要点

  • 给出 DBSCAN 中核心点、边界点、噪声点的判定条件? ε 和 minPts 增大/减小如何改变聚类结果?
  • 区分密度直达、密度可达、密度相连; 为什么密度可达不具备对称性而密度相连具备?
  • DBSCAN 与 K-Means 的核心区别? 各自适用什么数据形态? DBSCAN 对密度不均数据为何失效?
  • 层次聚类的单链接、全链接、Ward 准则分别用什么距离? 链式效应指什么?
  • DBSCAN 的时间复杂度与索引加速? 高维数据下为什么 ε 难选?