Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC More notes about the difference between the three base scorers #14358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions sklearn/metrics/scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ def make_scorer(score_func, greater_is_better=True, needs_proba=False,
>>> from sklearn.svm import LinearSVC
>>> grid = GridSearchCV(LinearSVC(), param_grid={'C': [1, 10]},
... scoring=ftwo_scorer)

Notes
-----
If `needs_proba=False` and `needs_threshold=False`, the score
function is supposed to accept the output of `predict`. If
`needs_proba=True`, the score function is supposed to accept the
output of `predict_proba` (For binary `y_true`, the score function is
supposed to accept probability of the positive class). If
`needs_threshold=True`, the score function is supposed to accept the
output of `decision_function`.
"""
sign = 1 if greater_is_better else -1
if needs_proba and needs_threshold:
Expand Down