clustering_base#


class EuclideanClusterer(noise_label=- 1, min_cluster_size: Optional[int] = None, max_cluster_size: Optional[int] = None)[source]#

Bases: PickleLoadSaveMixin, ABC

Base class for all clustering algorithms. Supports noise clusters and relabelling of identified clusters as noise based on their size.

Parameters:
  • noise_label – label that is associated with the noise cluster or None

  • min_cluster_size – if not None, clusters below this size will be labeled as noise

  • max_cluster_size – if not None, clusters above this size will be labeled as noise

class Cluster(datapoints: ndarray, identifier: Union[int, str])[source]#

Bases: object

centroid()[source]#
radius()[source]#
summary_dict()[source]#
Returns:

dictionary containing coarse information about the cluster (e.g. num_members and centroid)

clusters(condition: Optional[Callable[[Cluster], bool]] = None) Iterable[Cluster][source]#
Parameters:

condition – if provided, only clusters fulfilling the condition will be included

Returns:

generator of clusters

noise_cluster()[source]#
summary_df(condition: Optional[Callable[[Cluster], bool]] = None)[source]#
Parameters:

condition – if provided, only clusters fulfilling the condition will be included

Returns:

pandas DataFrame containing coarse information about the clusters

fit(data: ndarray) None[source]#
property is_fitted#
property datapoints: ndarray#
property labels: ndarray#
property cluster_identifiers: Set[int]#
get_cluster(cluster_id: int) Cluster[source]#
property num_clusters: int#