Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.metrics`.get_scorer

sklearn.metrics.get_scorer(scoring)

  Get a scorer from string.

  Read more in the User Guide. `get_scorer_names` can be used to retrieve the names of all available scorers.

  Parameters:
    scoring str, callable or None

      Scoring method as string. If callable it is returned as is. If None, returns None.

  Returns:
    scorer callable

      The scorer.

  Notes

  When passed a string, this function always returns a copy of the scorer object. Calling `get_scorer` twice for the same scorer results in two separate scorer objects.