# 空间聚类

空间聚类是一类数据分析方法，它将观测分组，使地理位置上彼此接近、且属性值往往相似的点落入同一聚类。它与仅基于属性的普通聚类不同之处在于，分组准则或算法本身会施加空间条件，例如点的最小局部密度，或并入同一区域的面状单元之间的邻接性。输出要么是一组点聚类外加一个噪声标签，要么是将面状单元划分为连片区域，后一任务也称为区域化。<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup><sup> • </sup><sup>[2](https://doi.org/10.1002/widm.30)</sup><sup> • </sup><sup>[3](https://geographicdata.science/book/notebooks/10_clustering_and_regionalization)</sup>

| 关键事实 | 值 |
|---|---|
| 定义性属性 | 聚类必须在空间上稠密或连片，而不仅仅是属性相似<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup><sup> • </sup><sup>[4](https://geodacenter.github.io/workbook/9c_spatial3/lab9c.html)</sup> |
| 代表性密度方法 | DBSCAN，参数为 Eps 和 MinPts；可发现任意形状的聚类并标记噪声<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup> |
| 代表性区域化方法 | SKATER，对基于空间权重矩阵构建的最小生成树进行剪枝<sup>[5](https://pysal.org/spopt/notebooks/skater.html)</sup> |
| DBSCAN 的平均时间复杂度 | 使用 R*树（R*-tree）索引时为 O(n log n)；最坏情况为 \( O(n^{2}) \)<sup>[6](https://www2.cs.uh.edu/~ceick/DM/WS-P1.pdf)</sup><sup> • </sup><sup>[7](https://ar5iv.labs.arxiv.org/html/2210.07580)</sup> |
| 主要失效模式 | 全局 Eps 会合并不同密度的聚类；边界点被任意分配；受约束拟合劣于无约束 k-means<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup><sup> • </sup><sup>[8](https://lanselin.github.io/introbook_vol1/dbscan.html)</sup><sup> • </sup><sup>[3](https://geographicdata.science/book/notebooks/10_clustering_and_regionalization)</sup> |
| 统计替代方法 | 空间扫描统计量，一种在圆形窗口上进行的似然比检验<sup>[9](https://doi.org/10.1080/03610929708831995)</sup> |

## 工作原理

**基于密度的方法**将聚类定义为对象密度高的连片区域，并由低密度区域与其他聚类分隔；位于低密度区域的对象是噪声或异常值。<sup>[2](https://doi.org/10.1002/widm.30)</sup> 在 DBSCAN 中，对于给定的 Eps 和 MinPts，当点 p 位于 q 的 Eps 邻域内，且该邻域至少包含 MinPts 个点（核心点条件）时，称 p 从 q 直接密度可达。密度可达具有传递性但不具有对称性；一个聚类是密度相连点的极大集合；不属于任何聚类的点是噪声。<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup> 因此，空间邻近性直接进入准则：标签只通过足够稠密的邻域传播。

**邻接约束方法**作用于面状数据。空间约束层次聚类仅当在满足 \( w_{ij} = 1 \) 的所有实体对中，实体 i 与 j 的相异度 \( d_{ij} \) 最小时才合并二者，其中 \( w_{ij} \) 是空间权重矩阵的非零元素；随后套用标准连接公式。<sup>[4](https://geodacenter.github.io/workbook/9c_spatial3/lab9c.html)</sup> 区域化是一种聚类，它将属性和位置都相似的观测归为一组，通常要求区域内存在一条路径连接其成员。由于受到约束，它在数学上不可能达到与无约束 k-means 相同的拟合得分，除非 k-means 的解恰好是一个有效区域化。<sup>[3](https://geographicdata.science/book/notebooks/10_clustering_and_regionalization)</sup>

## 实施方法

DBSCAN 的工作流程如下。首先，用 k-dist 启发式选择 Eps：它将每个点映射到其第 k 个最近邻的距离；排序后的 k-dist 图的第一个谷值给出阈值，原始作者对二维数据设 MinPts = 4（MinPts 计入点自身，因此这意味着 3 个邻居）。<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup><sup> • </sup><sup>[8](https://lanselin.github.io/introbook_vol1/dbscan.html)</sup> 其次，对每个点，使用 R*树等空间索引检索其 Eps 邻域；如果该邻域至少包含 MinPts 个点，就将该点标记为核心点，并通过其密度可达邻居递归扩展聚类。<sup>[10](https://doi.org/10.1145/93605.98741)</sup><sup> • </sup><sup>[11](https://webdocs.cs.ualberta.ca/~joerg/DissSander.pdf)</sup> 第三，将剩余点分类为边界点或噪声；在 scikit-learn 的实现中，默认值为 eps = 0.5、min_samples = 5，无需预先指定聚类数，噪声点获得标签 -1。<sup>[12](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN)</sup>

使用 SKATER 的区域化流程需要输入空间权重矩阵、目标聚类数和一个下限（最小区域规模）；该算法在单元上构建最小生成树，并对其边进行剪枝以形成连片区域。<sup>[5](https://pysal.org/spopt/notebooks/skater.html)</sup> 对此类解的空间验证指标包括破碎度（熵、辛普森）、连接计数比、紧凑度（等周商，\( (4 \cdot \pi \cdot \mathrm{面积}) / \mathrm{周长}^{2} \)）和直径。<sup>[13](https://geodacenter.github.io/pygeoda/spatial_clustering.html)</sup>

在支持区域查询的 R*树支持下，DBSCAN 的平均运行时间为 O(n log n)，每个点至多进行一次区域查询；无论 \( \epsilon \) 和 MinPts 如何，最坏情况仍为 \( O(n^{2}) \)。<sup>[6](https://www2.cs.uh.edu/~ceick/DM/WS-P1.pdf)</sup><sup> • </sup><sup>[7](https://ar5iv.labs.arxiv.org/html/2210.07580)</sup> 当 eps 较大且 min_samples 较低时，scikit-learn 实现的最坏情况内存为 \( O(n^{2}) \)，而原始算法使用线性内存。<sup>[12](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN)</sup>

## 起源

基于密度的空间聚类由马丁·埃斯特（Martin Ester）及其同事于 1996 年提出，论文题为《一种在含噪声的大型空间数据库中发现聚类的基于密度的算法》（A density-based algorithm for discovering clusters in large spatial Databases with Noise），发表于第二届知识发现与数据挖掘国际会议（International Conference on Knowledge Discovery and Data Mining）。<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup> 同一团队将该算法推广为 GDBSCAN，由约尔格·桑德（Jörg Sander）及其同事于 1998 年发表在《数据挖掘与知识发现》（Data Mining and Knowledge Discovery）上；该算法根据空间属性和非空间属性对一般空间对象进行聚类。<sup>[14](https://doi.org/10.1023/a:1009745219419)</sup> 更早的统计前身包括：斯坦·奥彭肖（Stan Openshaw）及其同事于 1987 年在《国际地理信息系统杂志》（International Journal of Geographical Information Systems）上提出的、用于点数据集自动化分析的 Mark 1 地理分析机（Mark 1 Geographical Analysis Machine）；<sup>[15](https://doi.org/10.1080/02693798708927821)</sup> 以及马丁·库尔多夫（Martin Kulldorff）于 1997 年在《统计学通讯：理论与方法》（Communication in Statistics - Theory and Methods）上引入的空间扫描统计量。<sup>[9](https://doi.org/10.1080/03610929708831995)</sup> 一些综述将扫描检验的似然比版本追溯到库尔多夫和纳加瓦拉（Nagarwalla）1995 年的工作，因此文献中报告的引入年份并不一致。<sup>[16](https://projecteuclid.org/journalArticle/Download?isResultClick=True&urlid=10.1214/21-SS132)</sup> 使 DBSCAN 区域查询变快的 R*树索引由诺贝特·贝克曼（Norbert Beckmann）及其同事于 1990 年在《ACM SIGMOD记录》（ACM SIGMOD Record）上描述。<sup>[10](https://doi.org/10.1145/93605.98741)</sup>

## 变体

**GDBSCAN** 用任意对称、自反的二元邻域谓词替代 Eps 邻域，并用加权基数函数替代点数，因此可以对面状要素和其他扩展对象进行聚类。<sup>[17](https://www2.cs.sfu.ca/~ester/papers/kdd_97.pdf)</sup> **ST-DBSCAN** 由德丽娅·比兰特（Derya Birant）和阿尔普·库特（Alp Kut）于 2006 年在《数据与知识工程》（Data & Knowledge Engineering）上描述；它通过三项修改扩展了 DBSCAN，分别涉及核心对象、噪声对象和相邻聚类的识别，并可根据非空间、空间和时间属性进行聚类；相关工作在空间半径 \( r_s \) 之外增加了单独的时间邻域半径 \( r_t \)。<sup>[18](https://doi.org/10.1016/j.datak.2006.01.013)</sup><sup> • </sup><sup>[19](https://www.mdpi.com/2220-9964/8/3/112)</sup> **ADBSCAN** 由穆罕默德·马哈穆杜尔·拉赫曼·汗（Mohammad Mahmudur Rahman Khan）及其同事于 2018 年在 arXiv 上提出，针对密度变化的聚类。<sup>[20](https://doi.org/10.48550/arxiv.1809.06189)</sup> 在区域化方面，**SKATER** 由 R. M. 阿松桑（R. M. Assunção）及其同事于 2006 年在《国际地理信息科学杂志》（International Journal of Geographical Information Science）上提出；它对最小生成树进行剪枝，但该树只考虑一阶邻接，并且不会为新形成的聚类更新邻接关系；**REDCAP** 则构建邻接约束树状图，将一阶邻接和全阶邻接与单连接、全连接和平均连接相结合（共六种方法，后来扩展到 Ward 连接），然后使用 SKATER 的逻辑进行切分。<sup>[4](https://geodacenter.github.io/workbook/9c_spatial3/lab9c.html)</sup> **max-p 区域**模型将区域化视为整数规划，区域数在下限约束下内生决定。<sup>[13](https://geodacenter.github.io/pygeoda/spatial_clustering.html)</sup> 近期工作集中在规模问题上：翁绍元（Shaoyuan Weng）、范宗文（Zongwen Fan）和苟进（Jin Gou）于 2024 年在《国际机器学习与控制论杂志》（International Journal of Machine Learning and Cybernetics）上发表的一篇论文描述了一种使用双向 HNSW 索引结构处理大数据的快速 DBSCAN；<sup>[21](https://doi.org/10.1007/s13042-024-02104-8)</sup> 贾加特·塞什·查拉（Jagat Sesh Challa）及其同事于 2024 年在《计算机科学与技术杂志》（Journal of Computer Science and Technology）上发表的一篇综述，考察了并行空间聚类算法的数据分配策略，包括参数化划分、基于单元的划分和基于投影的划分。<sup>[22](https://doi.org/10.1007/s11390-024-2700-0)</sup>

## 应用

在犯罪分析中，一项北京（Beijing）盗窃研究使用 ST-DBSCAN 刻画时空热点，在多个尺度上迭代空间和时间半径，并设 MinPts = 3；最优尺度下的热点包含了 36.5% 的盗窃事件。<sup>[23](https://link.springer.com/article/10.1186/s40163-020-00115-8)</sup> 在疾病监测中，扫描统计量及相关聚类检测方法被应用于泰国（Thailand）全国登革热记录等监测数据。<sup>[24](https://link.springer.com/article/10.1186/s12874-023-02135-9)</sup> SKATER、REDCAP 和 max-p 等区域化方法被应用于社会经济地理单元，例如将社区归并为同质的连片区域。<sup>[5](https://pysal.org/spopt/notebooks/skater.html)</sup><sup> • </sup><sup>[13](https://geodacenter.github.io/pygeoda/spatial_clustering.html)</sup>

## 局限与替代方法

DBSCAN 的全局 Eps 和 MinPts 可能将两个彼此接近但密度不同的聚类合并。<sup>[1](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)</sup> 边界点会被分配给最先到达它的核心点，即使它离另一个核心点更近也不能重新分配；DBSCAN* 完全舍弃边界点，仅由核心点形成聚类。寻找合适的 Eps 常被视为一个主要缺点。<sup>[8](https://lanselin.github.io/introbook_vol1/dbscan.html)</sup> 2017 年发表于《ACM数据库系统汇刊》（ACM TODS）的一篇通讯表明，在参数选择得当且索引有效时，原始 DBSCAN 的表现具有竞争力；对其性能的批评应针对关于 R 树（R-tree）索引行为的假设，而不是算法本身。<sup>[25](https://dl.acm.org/doi/10.1145/3068335)</sup>

主要的统计替代方法是空间扫描统计量，它在不同大小的圆形区域中寻找发病率显著升高的区域。<sup>[26](https://ar5iv.labs.arxiv.org/html/1711.04710)</sup> 其缺点包括只能检测单个圆形聚类、对不规则聚类的过高或过低估计，以及耗时的蒙特卡洛检验。<sup>[16](https://projecteuclid.org/journalArticle/Download?isResultClick=True&urlid=10.1214/21-SS132)</sup> 在一项使用 2019 年泰国登革热数据、比较 Getis-Ord Gi*、Local Moran、SaTScan 与贝叶斯 BYM 疾病制图的模拟研究中，Gi* 和 Local Moran 对孤立热点产生了更高的虚警率；SaTScan 在孤立峰值上表现突出，但其圆形窗口受泰国的不规则边界限制；BYM 模型则显得是最优方法。<sup>[24](https://link.springer.com/article/10.1186/s12874-023-02135-9)</sup> 一篇对局部自相关工具的批评指出，它们不考虑数值是否高或低到值得关注，而且忽略估计误差会使统计量偏高，并识别出比实际存在的更多聚类。<sup>[27](https://www.mdpi.com/1660-4601/18/18/9848)</sup> 与普通 k-means 相比，空间约束聚类总是以拟合度换取邻接性。<sup>[3](https://geographicdata.science/book/notebooks/10_clustering_and_regionalization)</sup>

## References

1. [A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise (KDD 1996)](https://cdn.aaai.org/KDD/1996/KDD96-037.pdf)
2. [Density-based clustering (Kriegel et al., WIREs Data Mining and Knowledge Discovery, 2011)](https://doi.org/10.1002/widm.30)
3. [Clustering and Regionalization – Geographic Data Science with Python](https://geographicdata.science/book/notebooks/10_clustering_and_regionalization)
4. [Spatial Clustering (2), GeoDa Center Workbook](https://geodacenter.github.io/workbook/9c_spatial3/lab9c.html)
5. [SKATER, spopt v0.7.0 Manual](https://pysal.org/spopt/notebooks/skater.html)
6. [A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise (copy of the KDD 1996 paper, performance sections)](https://www2.cs.uh.edu/~ceick/DM/WS-P1.pdf)
7. [GriT-DBSCAN: A Spatial Clustering Algorithm for Very Large Databases (arXiv)](https://ar5iv.labs.arxiv.org/html/2210.07580)
8. [20.3 DBSCAN | An Introduction to Spatial Data Science with GeoDa](https://lanselin.github.io/introbook_vol1/dbscan.html)
9. [Martin Kulldorff (1997). A spatial scan statistic. Communication in Statistics- Theory and Methods.](https://doi.org/10.1080/03610929708831995)
10. [Norbert Beckmann and colleagues (1990). The R*-tree: an efficient and robust access method for points and rectangles. ACM SIGMOD Record.](https://doi.org/10.1145/93605.98741)
11. [Jörg Sander's dissertation on density-based decompositions (GDBSCAN)](https://webdocs.cs.ualberta.ca/~joerg/DissSander.pdf)
12. [DBSCAN, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.DBSCAN)
13. [6 Spatial Clustering, pygeoda documentation](https://geodacenter.github.io/pygeoda/spatial_clustering.html)
14. [Jörg Sander and colleagues (1998). Density-Based Clustering in Spatial Databases: The Algorithm GDBSCAN and Its Applications. Data Mining and Knowledge Discovery.](https://doi.org/10.1023/a:1009745219419)
15. [STAN OPENSHAW and colleagues (1987). A Mark 1 Geographical Analysis Machine for the automated analysis of point data sets. International Journal of Geographical Information Systems.](https://doi.org/10.1080/02693798708927821)
16. [An up-to-date review of scan statistics](https://projecteuclid.org/journalArticle/Download?isResultClick=True&urlid=10.1214/21-SS132)
17. [Density-Connected Sets and their Application for Trend Detection (GDBSCAN, KDD 1997)](https://www2.cs.sfu.ca/~ester/papers/kdd_97.pdf)
18. [Derya Birant, Alp Kut (2006). ST-DBSCAN: An algorithm for clustering spatial–temporal data. Data & Knowledge Engineering.](https://doi.org/10.1016/j.datak.2006.01.013)
19. [Spatiotemporal Data Clustering: A Survey of Methods (ISPRS Int. J. Geo-Inf., 2019)](https://www.mdpi.com/2220-9964/8/3/112)
20. [Khan, Mohammad Mahmudur Rahman and colleagues (2018). ADBSCAN: Adaptive Density-Based Spatial Clustering of Applications with Noise for Identifying Clusters with Varying Densities. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1809.06189)
21. [Shaoyuan Weng, Zongwen Fan, Jin Gou (2024). A fast DBSCAN algorithm using a bi-directional HNSW index structure for big data. International Journal of Machine Learning and Cybernetics.](https://doi.org/10.1007/s13042-024-02104-8)
22. [Jagat Sesh Challa and colleagues (2024). A Survey and Experimental Review on Data Distribution Strategies for Parallel Spatial Clustering Algorithms. Journal of Computer Science and Technology.](https://doi.org/10.1007/s11390-024-2700-0)
23. [Exploring the homogeneity of theft offenders in spatio-temporal crime hotspots (Crime Science, 2020)](https://link.springer.com/article/10.1186/s40163-020-00115-8)
24. [Evaluation and comparison of spatial cluster detection methods... national dengue surveillance in Thailand (BMC Med Res Methodology, 2023)](https://link.springer.com/article/10.1186/s12874-023-02135-9)
25. [DBSCAN Revisited, Revisited: Why and How You Should (Still) Use DBSCAN (ACM TODS, 2017)](https://dl.acm.org/doi/10.1145/3068335)
26. [Spatio-Temporal Data Mining: A Survey of Problems and Methods (Atluri, Karpatne, Kumar, arXiv 2017)](https://ar5iv.labs.arxiv.org/html/1711.04710)
27. [Issues in the Current Practices of Spatial Cluster Detection and Exploring Alternative Methods (IJERPH)](https://www.mdpi.com/1660-4601/18/18/9848)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Multivariate association and dimension reduction › Titles Mo to W

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/spatial-clustering

English original: https://www.edgepedia.org/spatial-clustering
