-
Notifications
You must be signed in to change notification settings - Fork 463
BinaryAUROC
support for Masked Labels
#3268
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
base: master
Are you sure you want to change the base?
BinaryAUROC
support for Masked Labels
#3268
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements MaskedBinaryAUROC
metric to support masked labels in binary classification tasks, addressing issue #3096. This allows users to exclude certain predictions/targets from AUROC computation using a boolean mask.
Key changes include:
- Added
MaskedBinaryAUROC
class that extendsBinaryAUROC
with mask support - Enhanced the AUROC wrapper to support the new "maskedbinary" task type
- Comprehensive test coverage for the new masked functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/torchmetrics/classification/auroc.py | Core implementation of MaskedBinaryAUROC class and AUROC wrapper updates |
src/torchmetrics/classification/init.py | Export the new MaskedBinaryAUROC class |
src/torchmetrics/utilities/enums.py | Added "maskedbinary" classification task enum |
tests/unittests/classification/test_auroc.py | Comprehensive test suite for masked binary AUROC functionality |
tests/unittests/classification/_inputs.py | Test input data structures for masked binary cases |
CHANGELOG.md | Documentation of the new feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Adding optional type for mask Co-authored-by: Copilot <[email protected]>
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (37%) is below the target coverage (95%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3268 +/- ##
=======================================
- Coverage 37% 37% -1%
=======================================
Files 364 349 -15
Lines 20096 19916 -180
=======================================
- Hits 7520 7331 -189
- Misses 12576 12585 +9 🚀 New features to boost your workflow:
|
@Borda The unittest error seems to be coming from TestMultilabelLogAUC, an unrelated file to this PR. Similarly, the build docs error seems to be coming from logauc.py. This file was not touched. |
There was a bug in _inputs.py. It should be clear now. |
What does this PR do?
Fixes #3096
Before submitting
PR review
Added MaskedBinaryAUROC class implementation which updates the preds and target list with the corresponding mask. The other methods (compute, plot) remain the same.
Added all the relavant testcases.
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃
📚 Documentation preview 📚: https://torchmetrics--3268.org.readthedocs.build/en/3268/