clustering_base

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

Bases: sensai.util.cache.PickleLoadSaveMixin, abc.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

__init__(noise_label=- 1, min_cluster_size: Optional[int] = None, max_cluster_size: Optional[int] = None)
class Cluster(datapoints: numpy.ndarray, identifier: Union[int, str])

Bases: object

__init__(datapoints: numpy.ndarray, identifier: Union[int, str])
centroid()
radius()
summary_dict()
Returns

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

clusters(condition: Optional[Callable[[sensai.clustering.clustering_base.EuclideanClusterer.Cluster], bool]] = None) Iterable[sensai.clustering.clustering_base.EuclideanClusterer.Cluster]
Parameters

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

Returns

generator of clusters

noise_cluster()
summary_df(condition: Optional[Callable[[sensai.clustering.clustering_base.EuclideanClusterer.Cluster], bool]] = None)
Parameters

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

Returns

pandas DataFrame containing coarse information about the clusters

fit(data: numpy.ndarray) None
property is_fitted
property datapoints: numpy.ndarray
property labels: numpy.ndarray
property cluster_identifiers: Set[int]
get_cluster(cluster_id: int) sensai.clustering.clustering_base.EuclideanClusterer.Cluster
property num_clusters: int