Skip to content

confusion_matrix doesn't validate normalize keyword #15886

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

Closed
amueller opened this issue Dec 14, 2019 · 1 comment · Fixed by #15888
Closed

confusion_matrix doesn't validate normalize keyword #15886

amueller opened this issue Dec 14, 2019 · 1 comment · Fixed by #15888
Labels
Milestone

Comments

@amueller
Copy link
Member

amueller commented Dec 14, 2019

import numpy as np
from sklearn.metrics import confusion_matrix
confusion_matrix(np.random.randint(0, 5, size=100),
                 np.random.randint(0, 5, size=100), normalize='ohnodontdoit')

should raise an error but runs fine with no normalization. I found this because I did normalize=True and it didn't do anything and didn't raise an error.

@amueller amueller added the Bug label Dec 14, 2019
@qinhanmin2014 qinhanmin2014 added this to the 0.22.1 milestone Dec 14, 2019
@glemaitre
Copy link
Member

True we forgot to move the checking which is actually happening in plot_confusion_matrix (l. 187). This should be moved in confusion_matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants