Skip to content

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

Merged
glemaitre merged 3 commits into
scikit-learn-contrib:masterfrom
AYY7:fixes
Jul 8, 2023
Merged

FIX do not ignore target_names when output_dict=True in classification_report_imbalanced#989
glemaitre merged 3 commits into
scikit-learn-contrib:masterfrom
AYY7:fixes

Conversation

@AYY7

@AYY7 AYY7 commented Apr 29, 2023

Copy link
Copy Markdown
Contributor

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

@glemaitre glemaitre left a comment

Copy link
Copy Markdown
Member

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