INNER CODE UNIT · Python

b

TheAlgorithms/Jupyter · machine_learning/dbscan/dbscan.py:56

    b = pow((q[1] - p[1]), 2)
    return pow((a + b), 0.5)


def find_neighbors(db, q, eps):
    """
        Finds all points in the db that
        are within a distance of eps from Q

        eps value should be a number
        >>> find_neighbors({ (1,2):{'label':'undefined'}, (2,3):{'label':'undefined'}}, (2,5),'a')
        Traceback (most recent call last):
        ...
        ValueError: eps should be either int or float

        Q must be a 2-d point as list or tuple
        >>> find_neighbors({ (1,2):{'label':'undefined'}, (2,3):{'label':'undefined'}}, 2, 0.5)
        Traceback (most recent call last):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…