Your question is Implement ML Algorithm From Scratch. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
PAPER can use spatial clustering to group related points on a canvas. Implement the DBSCAN clustering algorithm from scratch for a set of points, without using machine learning or numerical libraries.
A point is a core point when its eps-radius neighborhood, including itself, contains at least min_points points. A point connected to a core point but not core itself is a border point. All other points are noise.
Assign cluster IDs in deterministic order by scanning points from left to right. The first discovered cluster must receive ID 1, the next ID 2, and so on. Noise points must be labeled -1.
Implement dbscan(points, eps, min_points), where points is a list of two-element numeric lists, eps is a positive distance threshold, and min_points is a positive integer. Return a list of integer labels with one entry per input point. Use Euclidean distance. Points exactly eps apart are neighbors.
def dbscan(points, eps, min_points):