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

FIX do not ignore target_names when output_dict=True in classification_report_imbalanced #989

Merged
merged 3 commits into from
Jul 8, 2023

Conversation

AYY7
Copy link
Contributor

@AYY7 AYY7 commented Apr 29, 2023

Reference Issue

Fixes #863

What does this implement/fix? Explain your changes.

When output_dict=True and target_names is given, set the keys of the output_dict to the corresponding target_names

{'label 1': {'pre':0.5,
             'rec':1.0,
             ...
            },
 'label 2': { ... },
  ...
}

When output_dict=True and target_names is not given, set the keys of the output_dict to the corresponding labels in str format

{'0': {'pre':0.5,
             'rec':1.0,
             ...
            },
 '1': { ... },
  ...
}

Any other comments?

@glemaitre glemaitre self-requested a review July 8, 2023 19:05
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM is on my side. I sync with master to see if the CIs agree.

@glemaitre glemaitre changed the title [MRG] Fix classification_report_imbalanced output_dict keys to target_names FIX do not ignore target_names when output_dict=True in classification_report_imbalanced Jul 8, 2023
@glemaitre glemaitre merged commit 5be5670 into scikit-learn-contrib:master Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] set classification_report_imbalanced output_dict keys to target_names
2 participants