-
Notifications
You must be signed in to change notification settings - Fork 459
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 recall #2518
Add recall #2518
Conversation
…h RecallMetric. Adapt confusionStats and Precision with generalized code.
… rename test function properly in precision.
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.
I have a couple of comments, otherwise good start! 🙂
…ation decision rule and class_reduction
# Conflicts: # crates/burn-train/src/learner/classification.rs # crates/burn-train/src/metric/confusion_stats.rs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2518 +/- ##
=======================================
Coverage 81.83% 81.84%
=======================================
Files 836 838 +2
Lines 107214 107302 +88
=======================================
+ Hits 87743 87821 +78
- Misses 19471 19481 +10 ☔ View full report in Codecov by Sentry. |
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.
Ok I think we're converging 😄
Just some changes regarding the config but otherwise I think it will be good to go after.
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.
LGTM! Just missing a tiny bit of doc for the decision rule.
/// The prediction decision rule for classification metrics. | ||
pub enum DecisionRule { | ||
Threshold(f64), | ||
TopK(NonZeroUsize), | ||
} |
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.
Ok! I think I've come around to the terminology behind this representation.
Just make sure to document both decision rules. Suggestions:
Top-k: Consider the prediction correct if the true label is within the top k predicted classes based on scores.
Threshold: Consider a class predicted if its probability exceeds the threshold.
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.
Great, I'm glad! Thanks for the tip and suggestions. I changed TopK
's slightly. Let me know what you think.
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.
Let's go 🚀
Pull Request Template
Checklist
run-checks all
script has been executed.Related Issues/PRs
#544
Changes
Create
ClassificationInput
andClassificationConfig
, generalizations ofPrecisionInput
andPrecisionConfig
for any classification task (currently used by precision and recall).Add
RecallMetric
.Moved ClassReduction into ClassificationConfig, since i think they belong together.
Testing
Added tests for recall