dbscan package

Submodules

dbscan.dbscan module

class dbscan.dbscan.DBSCAN(eps, min_samples)[source]

Bases: object

Density-Based Spatial Clustering of Applications with Noise.

fit(X)[source]

Perform DBSCAN clustering from vector array.

Parameters:

X (np.array) – Input data (points).

Returns:

self

dbscan.utils module

dbscan.utils.euclidean_distance(point_a, point_b)[source]

Calculates the Euclidean distance between two points.

Parameters:
  • point_a (np.array) – Coordinates of the first point.

  • point_b (np.array) – Coordinates of the second point.

Returns:

The distance between points.

Return type:

float

dbscan.visualization module

dbscan.visualization.plot_clusters(X, labels, title='DBSCAN Clustering')[source]

Plots the data points colored by their cluster label. Noise points (label -1) are colored black.

Parameters:
  • X (np.array) – Data points (2D).

  • labels (list/array) – Cluster labels for each point.

  • title (str) – Title of the plot.

Module contents