-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[WIP] rewrite precision_recall_fscore_support #1990
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes bugs related to simply checking type(..) equality, and refactors.
Rewrite no longer does shape checks
The remaining test failures result from problems in the previous implementation, the currently unhandled
|
Rebased on #1988 to correct values in test cases. |
and helper function for metrics
…understand my own wording.
Also, support 1d-array of sequences as a multilabel format
Also, deprecate pos_label in favour of neg_label
Also, fix error messages without spaces
Status of this PR:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
precision_recall_fscore_support
was getting gargantuan, because the similarities between the different input formats and metric variations weren't being exploited; rather, almost everything was special-cased. As a result, some bugs and inconsistencies crept in (admittedly on my watch as a reviewer).This implementation:
LabelEncoder
to usebincount
(and building upon vectorized multilabel support in FIX helper to check multilabel types #1985, ENH support multilabel targets in LabelEncoder #1987).pos_label
and introducesneg_label
, which allows micro-averaging to be interesting in the multiclass case (see ENH P/R/F should be able to ignore a majority class in the multiclass case #1983).neg_label
has not yet been tested.has not yet implemented support for theI wishlabels
argument, largely because I don't know what it means (see DOC clarify the use oflabel
in P/R/F metric family #1989). It's not hard to implement, butlabels
were deprecated in favour of stating a convention regarding label ordering in theaverage=None
case.has not yet fixed some broken tests for multilabelaverage='samples'
precision_score
, etc. derivative functions regardingpos/neg_label
I think this is incorrect behaviour, but it is backward-compatible (except with theThe decision made elsewhere is to use 0 and warn. This is not yet implemented.average='samples'
implementation; again, whoops): precision should be perfect when recalling nothing; recall should be perfect when there are no instances to retrieve. (And not realising that scikit-learn had adopted the 0 approach, I suggested in the documentation that 1 should be used.)