Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-154

DBSCAN Core Point Check

Problem

A point is a core point when its eps-neighborhood (including itself) contains at least min_pts points.

Return True or False.

Hint

The neighborhood always includes the point itself.

Test cases

case 1
in: [[[0,0],[0.5,0],[2,0],[2.5,0]],0,1,2]
expected: true
case 2
in: [[[0,0],[0.5,0],[2,0],[2.5,0]],3,0.1,2]
expected: false
case 3
in: [[[0,0],[0.5,0],[2,0],[2.5,0]],3,0.1,1]
expected: true
Starter codePython
def is_core_point(points, i, eps, min_pts):
    # Your code here
    pass

3 test cases · run your code against them in the editor