-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
[MRG] ENH add normalize parameter to confusion_matrix #15625
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
left a comment
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.
Looks good. I agree it makes more sense to have it in confusion_matrix rather than in the plot utility
| normalize : {'true', 'pred', 'all'}, default=None | ||
| Normalizes confusion matrix over the true (rows), predicted (columns) | ||
| conditions or all the population. If None, confusion matrix will not be |
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.
what is "conditions"?
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.
True conditions, predicted conditions. I think that it is one way to call true values and predicted values.
| normalize : {'true', 'pred', 'all'}, default=None | ||
| Normalizes confusion matrix over the true (rows), predicited (columns) | ||
| Normalizes confusion matrix over the true (rows), predicted (columns) | ||
| conditions or all the population. If None, confusion matrix will not be |
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.
same here lol
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 copied it from here :). Seeking a bit more, this is defined in this way on wikipedia: https://en.wikipedia.org/wiki/Confusion_matrix
qinhanmin2014
left a comment
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'm still wondering why we need to divide the entire matrix (though I won't oppose).
|
Seems that @jnothman don't like it? #14478 (comment) |
|
Not against, just needed the normalisation to have options, as here
|
Reference Issues/PRs
closes #14478
What does this implement/fix? Explain your changes.
Move the normalization
normalizefromplot_confusion_matrixtoconfusion_matrix.I added a couple of test and handle division by zeros without raising warning.
Any other comments?