Classification metrics overhaul: precision & recall (4/n)#4842
Merged
rohitgr7 merged 92 commits intoLightning-AI:release/1.2-devfrom Jan 18, 2021
tadejsv:cls_metrics_precision_recall
Merged
Classification metrics overhaul: precision & recall (4/n)#4842rohitgr7 merged 92 commits intoLightning-AI:release/1.2-devfrom tadejsv:cls_metrics_precision_recall
rohitgr7 merged 92 commits intoLightning-AI:release/1.2-devfrom
tadejsv:cls_metrics_precision_recall
Conversation
|
Hello @tadejsv! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-01-17 18:02:19 UTC |
…orch-lightning into cls_metrics_precision_recall
…ics_precision_recall
tchaton
reviewed
Jan 15, 2021
| assert get_num_classes(pred, target, num_classes) == expected_num_classes | ||
|
|
||
|
|
||
| @pytest.mark.parametrize(['pred', 'target', 'expected_tp', 'expected_fp', |
Contributor
There was a problem hiding this comment.
Why did we remove those tests ?
Contributor
Author
There was a problem hiding this comment.
I am removing tests for deprecated functions. This was also done in other PRs before, see #4704
…orch-lightning into cls_metrics_precision_recall
rohitgr7
approved these changes
Jan 15, 2021
Contributor
rohitgr7
left a comment
There was a problem hiding this comment.
Looks good. Just some comments.
12 tasks
Borda
approved these changes
Jan 15, 2021
Collaborator
Borda
left a comment
There was a problem hiding this comment.
some minor comments, but otherwise it LGTM ;]
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
…ics_precision_recall
justusschock
approved these changes
Jan 18, 2021
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
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.
This PR is a spin-off from #4835.
What does this PR do?
Recall, Precision
These are all metrics that can be represented as a (quotient) function of "stat scores" - thanks to subclassing
StatScorestheir code is extremely simple. Here are the parameters common to all of them:average: this builds on thereduceparameter in StatScores. The options here (micro,macro,weighted,noneor None,samples) are exactly equivalent to the sklearn counterparts, so I won't go into details.mdmc_average: builds on themdmc_reducefrom StatScores. This decides how to average scores for multi-dimensional multi-class inputs. Already discussed inmdmc_reduce.Both also get the
top_kparameter, enabling their use as Recall@K and Precision@K - very useful for information retrieval.Deprecations
I have deprecated
precision_recallmetric, as well as the oldprecisionandrecall(in case someone was importing them using the full path, otherwise they are replaced by the newprecisionandrecall)