sklearn.base.ClusterMixin

class sklearn.base.ClusterMixin[source]

Mixin class for all cluster estimators in scikit-learn.

Methods

fit_predict(self, X[, y])

Performs clustering on X and returns cluster labels.

__init__(self, /, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

fit_predict(self, X, y=None)[source]

Performs clustering on X and returns cluster labels.

Parameters
Xndarray, shape (n_samples, n_features)

Input data.

yIgnored

not used, present for API consistency by convention.

Returns
labelsndarray, shape (n_samples,)

cluster labels