Skip to content
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

Add method to rename classes #98

Closed
Erotemic opened this issue Nov 12, 2018 · 1 comment
Closed

Add method to rename classes #98

Erotemic opened this issue Nov 12, 2018 · 1 comment
Assignees
Labels
enhancement New feature or request new feature
Milestone

Comments

@Erotemic
Copy link

It would be useful if there was a method to rename the classes.

In many workflows it is common to encode class names as integers. However, when working with final results it is most useful to convert these integers back into the string class names.

It would be useful to do this after the construction of the ConfusionMatrix, because it is more efficient to remap the labels on the matrix rows and columns than it is to rename each item in the actual and predicted vectors (which can be quite large).

Something like ConfusionMatrix.rename(mapping) or ConfusionMatrix.relabel(mapping) might be a good method signature where mapping is a dictionary of old names to new names. It would also be useful if this method "did the right thing" when multiple old names mapped to a single new name (i.e. sum the counts in the corresponding matrix cells).

@sepandhaghighi
Copy link
Owner

@Erotemic

Good point ;-)
I will add this in next releases ;-)

@sepandhaghighi sepandhaghighi self-assigned this Nov 12, 2018
@sepandhaghighi sepandhaghighi added enhancement New feature or request new feature labels Nov 12, 2018
sepandhaghighi added a commit that referenced this issue Nov 18, 2018
sepandhaghighi added a commit that referenced this issue Nov 18, 2018
sepandhaghighi added a commit that referenced this issue Nov 18, 2018
sepandhaghighi added a commit that referenced this issue Nov 18, 2018
@sepandhaghighi sepandhaghighi added this to the PYCM 1.5 milestone Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature
Projects
None yet
Development

No branches or pull requests

2 participants