Skip to content
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

FBeta update #111

Merged
merged 15 commits into from
Mar 24, 2021
Merged

FBeta update #111

merged 15 commits into from
Mar 24, 2021

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Mar 19, 2021

Before submitting

  • Was this discussed/approved 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?

What does this PR do?

Fixes #55
Fixes #58

Updates the internals of fbeta metric to use the stats score metric internal (similar to precision/recall). In addition to standardizing the interface even more, it also adds support for:

  • TopK calculates
  • Average='samples'
  • ignore_index argument for ignoring specific classes
  • mdmc_average for how to aggregate when working with multi dimensional tensors

When everything is standardized to using the stat score metric it will be easier to implement support for non-normalized input (see issue #60 and #74)

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 🙃

@pep8speaks
Copy link

pep8speaks commented Mar 19, 2021

Hello @SkafteNicki! Thanks for updating this PR.

Line 56:13: W503 line break before binary operator

Comment last updated at 2021-03-24 14:57:42 UTC

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use the shorten typing for torch.Tensor

@Borda
Copy link
Member

Borda commented Mar 22, 2021

@SkafteNicki mind check the failing tests :]

AttributeError: 'FBeta' object has no attribute 'average'

@Borda Borda added ready and removed ready labels Mar 24, 2021
@SkafteNicki
Copy link
Member Author

@Borda should be fixed now :]

@codecov
Copy link

codecov bot commented Mar 24, 2021

Codecov Report

Merging #111 (aa0f001) into master (9a73d5e) will decrease coverage by 0.49%.
The diff coverage is 98.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   97.25%   96.75%   -0.50%     
==========================================
  Files         140      140              
  Lines        4366     4376      +10     
==========================================
- Hits         4246     4234      -12     
- Misses        120      142      +22     
Flag Coverage Δ
Linux 78.83% <68.51%> (-1.06%) ⬇️
Windows 78.83% <68.51%> (-1.06%) ⬇️
cpu 96.75% <98.14%> (-0.50%) ⬇️
gpu 96.75% <ø> (-0.50%) ⬇️
macOS 96.75% <98.14%> (-0.50%) ⬇️
pytest 96.75% <98.14%> (-0.50%) ⬇️
python3.6 96.74% <98.14%> (-0.50%) ⬇️
python3.8 96.75% <98.14%> (-0.50%) ⬇️
python3.9 96.75% <98.14%> (-0.50%) ⬇️
torch1.3.1 ?
torch1.4.0 95.33% <98.14%> (-0.50%) ⬇️
torch1.8.0 96.75% <98.14%> (-0.50%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...hmetrics/functional/retrieval/average_precision.py 80.00% <50.00%> (ø)
torchmetrics/classification/f_beta.py 100.00% <100.00%> (+3.12%) ⬆️
torchmetrics/functional/classification/f_beta.py 100.00% <100.00%> (ø)
torchmetrics/retrieval/retrieval_metric.py 98.00% <100.00%> (ø)
torchmetrics/utilities/data.py 95.31% <100.00%> (ø)
torchmetrics/utilities/checks.py 91.55% <0.00%> (-7.80%) ⬇️
__w/1/s/torchmetrics/utilities/checks.py 91.55% <0.00%> (-7.80%) ⬇️
...s/torchmetrics/functional/classification/f_beta.py 100.00% <0.00%> (ø)
__w/1/s/torchmetrics/classification/f_beta.py 100.00% <0.00%> (+3.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a73d5e...aa0f001. Read the comment docs.

@Borda
Copy link
Member

Borda commented Mar 24, 2021

cool, the last missing is docs, some formatting issue...

@Borda Borda enabled auto-merge (squash) March 24, 2021 10:43
@Borda Borda added the ready label Mar 24, 2021
@Borda Borda merged commit 691b5d6 into master Mar 24, 2021
@Borda Borda deleted the f_beta_update branch March 24, 2021 19:32
@Borda Borda added this to the 0.3 milestone Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready
Projects
None yet
4 participants