meerkat.clusterby¶

clusterby(data: DataFrame, by: Union[str, Sequence[str]], method: Union[str, 'ClusterMixin'] = 'KMeans', encoder: str = 'clip', modality: str = None, **kwargs) ClusterBy[source]¶

Perform a clusterby operation on a DataFrame.

Parameters
  • data (DataFrame) – The dataframe to cluster.

  • by (Union[str, Sequence[str]]) – The column(s) to cluster by. These columns will be embedded using the encoder and the resulting embedding will be used.

  • method (Union[str, "ClusterMixin"]) – The clustering method to use.

  • encoder (str) – The encoder to use for the embedding. Defaults to clip.

  • modality (Union[str, Sequence[str])) – The modality to of the

  • **kwargs – Additional keyword arguments to pass to the clustering method.

Returns

A ClusterBy object.

Return type

ClusterBy