Skip to content

fix: ignore zero and negative predictions in retrieval metrics#3160

Merged
Borda merged 7 commits into
Lightning-AI:masterfrom
rittik9:rittik/retrieval
Jul 2, 2025
Merged

fix: ignore zero and negative predictions in retrieval metrics#3160
Borda merged 7 commits into
Lightning-AI:masterfrom
rittik9:rittik/retrieval

Conversation

@rittik9

@rittik9 rittik9 commented Jul 1, 2025

Copy link
Copy Markdown
Collaborator

What does this PR do?

Fixes #3104

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?
PR review

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--3160.org.readthedocs.build/en/3160/

@rittik9 rittik9 changed the title fix: ignore zero and negative predictions in retrieval metrics fix: ignore zero and negative predictions in retrieval metrics[WIP] Jul 1, 2025
@codecov

codecov Bot commented Jul 1, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34%. Comparing base (16a16bf) to head (fa90595).
⚠️ Report is 84 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (16a16bf) and HEAD (fa90595). Click for more details.

HEAD has 64 uploads less than BASE
Flag BASE (16a16bf) HEAD (fa90595)
gpu 2 0
unittest 2 0
torch2.0.1+cpu 5 3
python3.10 21 11
Windows 4 2
cpu 31 16
torch2.7.1 2 1
macOS 6 3
python3.12 8 4
torch2.7.1+cpu 6 3
torch2.0.1 4 2
Linux 21 11
torch2.6.0+cpu 4 2
torch2.1.2+cpu 2 1
torch2.5.1+cpu 2 1
torch2.2.2+cpu 2 1
python3.9 2 1
torch2.4.1+cpu 2 1
torch2.3.1+cpu 2 1
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #3160     +/-   ##
========================================
- Coverage      70%     34%    -36%     
========================================
  Files         364     349     -15     
  Lines       20060   19870    -190     
========================================
- Hits        14084    6703   -7381     
- Misses       5976   13167   +7191     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rittik9 rittik9 changed the title fix: ignore zero and negative predictions in retrieval metrics[WIP] fix: ignore zero and negative predictions in retrieval metrics Jul 2, 2025
@rittik9

rittik9 commented Jul 2, 2025

Copy link
Copy Markdown
Collaborator Author

Hi @Borda, this one is ready for review. This solves the problem mentioned in original pr. As that pr needed a lot of changes so I opened a new one.

@Borda
Borda merged commit 393f62b into Lightning-AI:master Jul 2, 2025
48 of 56 checks passed
@mergify mergify Bot added the ready label Jul 2, 2025
Borda added a commit that referenced this pull request Jul 3, 2025
* feat: ignore zero and negative preds
* update average_precision to ignore zero and negative predictions
* update recall to ignore zero and negative predictions
* update precision to ignore zero and negative predictions
* add tests

---------

Co-authored-by: AymenKallala <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
(cherry picked from commit 393f62b)
Borda added a commit that referenced this pull request Jul 5, 2025
* feat: ignore zero and negative preds
* update average_precision to ignore zero and negative predictions
* update recall to ignore zero and negative predictions
* update precision to ignore zero and negative predictions
* add tests

---------

Co-authored-by: AymenKallala <[email protected]>
Co-authored-by: Jirka Borovec <[email protected]>
(cherry picked from commit 393f62b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants