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 parameter prepare_together_function to WrappedMetricWithPrepareFunction #129

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

ArneBinder
Copy link
Owner

... and make prepare_function optional. From the docstring:

prepare_function: A function that prepares the input for the metric. If provided, It is called with
    the predictions as well as the targets (separately).
prepare_together_function: A function that prepares both the predictions and the targets together and
    should return them as a tuple. If provided, it is called with the predictions and the targets as
    arguments.

Motivation: This can be used to remove true negatives (TNs) from metric calculation.

@ArneBinder ArneBinder added the enhancement New feature or request label Oct 8, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.63%. Comparing base (3c31d85) to head (475fd0d).

Files with missing lines Patch % Lines
...es/metrics/wrapped_metric_with_prepare_function.py 92.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
- Coverage   95.68%   95.63%   -0.05%     
==========================================
  Files          61       61              
  Lines        5077     5089      +12     
==========================================
+ Hits         4858     4867       +9     
- Misses        219      222       +3     

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

@ArneBinder ArneBinder merged commit 218fc87 into main Oct 8, 2024
2 checks passed
@ArneBinder ArneBinder deleted the wrapped_metric/prepare_together_function branch October 8, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants