docs(auroc): clarify per-batch logit/probability check in BinaryAUROC - #3474
Open
mohansree14 wants to merge 1 commit into
Open
docs(auroc): clarify per-batch logit/probability check in BinaryAUROC#3474mohansree14 wants to merge 1 commit into
mohansree14 wants to merge 1 commit into
Conversation
Fixes Lightning-AI#2195 - the sigmoid-vs-probability check in update() runs per batch, not across the full dataset, which can silently produce inconsistent conversion behavior across batches. Documented this in the class docstring.
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #3474 +/- ##
========================================
- Coverage 37% 31% -6%
========================================
Files 349 349
Lines 19901 19910 +9
========================================
- Hits 7264 6170 -1094
- Misses 12637 13740 +1103 🚀 New features to boost your workflow:
|
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.
What does this PR do?
Fixes #2195
BinaryAUROC.update()(inherited fromBinaryPrecisionRecallCurve) checks per batch whetherpredslooks like logits (values outside[0, 1]) and appliessigmoidif so. This check runs independently on everyupdate()call rather than once across the full accumulated dataset, so with small batch sizes it's possible for some batches to be treated as probabilities and others as logits within the same run, producing inconsistent results.Per the reporter's suggested resolution, this PR documents that behavior more prominently in
BinaryAUROC's class docstring rather than changing the underlying per-batch logic (which other metrics also rely on), to keep this a minimal, low-risk documentation fix. Happy to extend this to the baseBinaryPrecisionRecallCurvedocstring too, or take a different approach, if maintainers prefer.Before submitting
This is my first contribution to this repo — feedback welcome.