locan.data.cluster.clustering.cluster_dbscan#

locan.data.cluster.clustering.cluster_dbscan(locdata, eps=20, min_samples=5, loc_properties=None, **kwargs)[source]#

Cluster localizations in locdata using the dbscan clustering algorithm as implemented in sklearn.

Parameters:
  • locdata (LocData) – specifying the localization data on which to perform the manipulation.

  • eps (float) – The maximum distance between two samples for them to be considered as in the same neighborhood.

  • min_samples (int) – The number of samples in a neighborhood for a point to be considered as a core point. This includes the point itself.

  • loc_properties (Optional[list[str]]) – The LocData properties to be used for clustering. If None, locdata.coordinates will be used.

  • kwargs (Any) – Other parameters passed to sklearn.cluster.DBSCAN.

Returns:

A tuple with noise and cluster. The first LocData object is a selection of all localizations that are defined as noise, in other words all localizations that are not part of any cluster. The second LocData object is a LocData instance assembling all generated selections (i.e. localization cluster).

Return type:

tuple[LocData, LocData]