What is "check_scoring" in sklearn.metrics?

515 Views Asked by At

What is check_scoring in sklearn.metrics, how does it work, and what is it its difference with make_scorer?

1

There are 1 best solutions below

0
On BEST ANSWER

check_scoring is mainly used as an internal method to ensure score methods are valid.

It returns the same type of instance as a make_scorer, or a default score if None is provided:

>>> from sklearn.tree import DecisionTreeClassifier
>>> from sklearn.tree import DecisionTreeRegressor
>>> clf = DecisionTreeClassifier()
>>> regr = DecisionTreeRegressor()

>>> from sklearn.metrics import check_scoring

>>> check_scoring(clf, scoring="recall")
make_scorer(recall_score, average=binary)

>>> check_scoring(regr, scoring="r2")
make_scorer(r2_score)

So: you'll probably use make_scorer more often.

See also: scoring in scikit-learn's glossary