-
-
Notifications
You must be signed in to change notification settings - Fork 26k
Correct docstring definition for log_loss function #16037
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
Conversation
@NicolasHug let me know if this looks merge-able! |
sklearn/metrics/_classification.py
Outdated
@@ -2088,8 +2088,8 @@ def log_loss(y_true, y_pred, eps=1e-15, normalize=True, sample_weight=None, | |||
|
|||
This is the loss function used in (multinomial) logistic regression | |||
and extensions of it such as neural networks, defined as the negative | |||
log-likelihood of the true labels given a probabilistic classifier's | |||
predictions. The log loss is only defined for two or more labels. | |||
log-likelihood of the classfier given the true labels. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is helpful as a definition. I suppose we mean that log_loss(y_true, y_pred)
is defined as the likelihood of a logistic model that returns y_pred
probabilities for its training data y_true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorporated in the pr.
I'm happy with @jnothman 's proposal |
Thanks @sid21g , as you can see the CI isn't happy because you have some line-too-long issues. Please make sure everything fits under 79 characters. Otherwise looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise, thanks @sid21g
Co-Authored-By: Nicolas Hug <[email protected]>
let us know @jnothman if we can close this |
Thanks @sid21g |
Reference Issues/PRs
Fixes #16026
What does this implement/fix? Explain your changes.
Corrects erroneous docstring under log_loss function.