INNER CODE UNIT · Python

dbscan

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

def dbscan(db, eps, min_pts):
    """
        Implementation of the DBSCAN algorithm

        Points must be in correct format
        >>> dbscan([], (2,2) ,0.4)
        Traceback (most recent call last):
        ...
        TypeError: db must be a dict of points in the format {(x,y):{'label':'boolean/undefined'}}

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

        min_pts value should be an integer
        >>> dbscan({ (1,2):{'label':'undefined'}, (2,3):{'label':'undefined'}},0.4,20.0 )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…