Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.base`.ClassifierMixin

class sklearn.base.ClassifierMixin

  Mixin class for all classifiers in scikit-learn.

  Methods

  `score`(X, y[, sample_weight]) | Return the mean accuracy on the given test data and labels.

  score(X, y, sample_weight=None)

    Return the mean accuracy on the given test data and labels.

    In multi-label classification, this is the subset accuracy which is a harsh metric since you require for each sample that each label set be correctly predicted.

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

        Test samples.

      y array-like of shape (n_samples,) or (n_samples, n_outputs)

        True labels for `X`.

      sample_weight array-like of shape (n_samples,), default=None

        Sample weights.

    Returns:
      score float

        Mean accuracy of `self.predict(X)` w.r.t. `y`.

## Examples using `sklearn.base.ClassifierMixin`

__sklearn_is_fitted__ as Developer API

__sklearn_is_fitted__ as Developer API

Metadata Routing

Metadata Routing