Skip to content

confusion_matrix doesn't validate normalize keyword #15886

@amueller

Description

@amueller
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions