Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.metrics`.check_scoring

sklearn.metrics.check_scoring(estimator, scoring=None, *, allow_none=False)

  Determine scorer from user options.

  A TypeError will be thrown if the estimator cannot be scored.

  Parameters:
    estimator estimator object implementing ‘fit’

      The object to use to fit the data.

    scoring str or callable, default=None

      A string (see model evaluation documentation) or a scorer callable object / function with signature `scorer(estimator, X, y)`. If None, the provided estimator object’s `score` method is used.

    allow_none bool, default=False

      If no scoring is specified and the estimator has no score function, we can either return None or raise an exception.

  Returns:
    scoring callable

      A scorer callable object / function with signature `scorer(estimator, X, y)`.