Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.base`.ClusterMixin

class sklearn.base.ClusterMixin

  Mixin class for all cluster estimators in scikit-learn.

  Methods

  `fit_predict`(X[, y]) | Perform clustering on `X` and returns cluster labels.

  fit_predict(X, y=None)

    Perform clustering on `X` and returns cluster labels.

    Parameters:
      X array-like of shape (n_samples, n_features)

        Input data.

      y Ignored

        Not used, present for API consistency by convention.

    Returns:
      labels ndarray of shape (n_samples,), dtype=np.int64

        Cluster labels.