Lesson 10 of 15
DBSCAN Core Operations
DBSCAN: Density-Based Clustering
DBSCAN (Density-Based Spatial Application of Noise) clusters points that are densely packed together while labelling sparse outliers as noise. Unlike k-means, it does not require choosing in advance.
Key Concepts
Epsilon neighbourhood (-neighbourhood): the set of points within distance of a point :
Core point: a point with at least min_samples neighbours within (excluding itself):
Border point: within of a core point but not itself a core point.
Noise point: neither core nor border.
Algorithm Sketch
for each unvisited point p:
if p is a core point:
expand cluster from p (BFS/DFS through neighbours)
else:
mark p as noise (may later become a border point)
Your Task
Implement the building blocks:
neighbors(X, idx, eps)→ indices of points within (excludingidxitself)is_core_point(X, idx, eps, min_samples)→ True if min_samplesrange_query(X, idx, eps)→ same asneighbors(alias used during cluster expansion)
Python runtime loading...
Loading...
Click "Run" to execute your code.