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

add fscore, reorganize mod and change error in doc. #2648

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

tsanona
Copy link
Contributor

@tsanona tsanona commented Jan 2, 2025

Pull Request Template

Checklist

  • Confirmed that run-checks all script has been executed.
  • Made sure the book is up to date with changes in this PR.

Related Issues/PRs

#544

Changes

Add FβScoreMetric
Reorganize metric\mod to mach existing order.

Testing

Added tests for new metric

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

Attention: Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.

Project coverage is 83.14%. Comparing base (7a19b5f) to head (d2edd87).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
crates/burn-train/src/metric/fbetascore.rs 90.27% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2648      +/-   ##
==========================================
+ Coverage   81.84%   83.14%   +1.29%     
==========================================
  Files         838      840       +2     
  Lines      107487   107985     +498     
==========================================
+ Hits        87975    89784    +1809     
+ Misses      19512    18201    -1311     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@laggui laggui self-requested a review January 3, 2025 21:01
Copy link
Member

@laggui laggui left a comment

Choose a reason for hiding this comment

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

Thanks for contributing yet another metric 😄

Minor comment regarding the name, otherwise should be good to go!

| Accuracy | Calculate the accuracy in percentage |
| TopKAccuracy | Calculate the top-k accuracy in percentage |
| Precision | Calculate precision in percentage |
| Recall | Calculate recall in percentage |
| FScore | Calculate f<sub>β</sub>score in percentage |
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: rename to FBetaScore. It seems that many people refer to F-score as F-beta score (as it is parameterized by beta).

See sklearn for example: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.fbeta_score.html

Copy link
Member

@laggui laggui Jan 6, 2025

Choose a reason for hiding this comment

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

Also, can you fix the trailing spaces that misalign the right table border 😅

And the F in Fβ score should be capitalized (and maybe add a space like I did for readability?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was torn and chose the smallest name, but I also agree with this, will change!
Ah yes will format the table didn't realize it was misaligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While I agree the F should be capitalized, it feels like it isn't consistent with the other metric names, should I also change the others or just capitalize the F?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's consistent. The F-score is always capitalized (based on its origin), ROC is an acronym for Receiver Operating Characteristic. Other names are not capitalized because they're really just nouns (precision, recall, accuracy). I guess there could be a debate over top-k vs Top-k, but even wikipedia doesn't capitalize it 😅

@tsanona
Copy link
Contributor Author

tsanona commented Jan 7, 2025

All good, it's been fulfilling to contribute! 🌟 I have now plans to adapt the existing metrics (accuracy+topkaccuracy, auroc and hamming) to the same format as the ones I've implemented. (this will be breaking code, which I'm not fully sure on how to handle)
I also want to add a few more losses and, or and and ops to Bool tensors and scatter and select* ops to all tensors (not just numeric).
If there's some priority/no necessity of any of these I'd be interested in discussing 🚀 Should I just create prs or is there a better way to start these discussions?

@tsanona tsanona requested a review from laggui January 7, 2025 15:25
@laggui
Copy link
Member

laggui commented Jan 7, 2025

I have now plans to adapt the existing metrics (accuracy+topkaccuracy, auroc and hamming) to the same format as the ones I've implemented. (this will be breaking code, which I'm not fully sure on how to handle)

Not sure what do yo have in mind?

We try to limit breaking changes, but sometimes that's not possible. Depends on the objective I guess!

I also want to add a few more losses and, or and and ops to Bool tensors and scatter and select* ops to all tensors (not just numeric). If there's some priority/no necessity of any of these I'd be interested in discussing 🚀 Should I just create prs or is there a better way to start these discussions?

I think missing features are mostly captured in issues. If a feature request is not already filed, you can open an issue for the request and the discussion can start there 🙂

For other general dev discussions and thoughts, this usually happens on discord.

@laggui laggui merged commit a644430 into tracel-ai:main Jan 7, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants