-
Notifications
You must be signed in to change notification settings - Fork 7
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
Metrics validate that the matcher is supported #170
Conversation
- Add abstract function to base Metric - Implement _validate_matcher for each metric - Eliminate uses of CTCMatcher with div metrics
… a required argument for Matched
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.
Generally looks good! Thanks for implementing :) just left a few comments inline
src/traccuracy/metrics/_ctc.py
Outdated
valid_matchers = {"IOUMatcher", "CTCMatcher"} | ||
name = matched.matcher_info["name"] | ||
|
||
if name in valid_matchers: |
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.
Could just return name in valid_matchers
but this is a style thing
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.
Approving with the caveat that it should be strictly greater than 0.5 for true one-to-one-ness :) but I don't feel the need to review again once that's fixed!
Closes #83
Ultimately we are embracing a very manual/hard-coded approach. Each metric has to implement its own
_validate_matcher
function that can check both the name of the matcher and any associated parameters that may be relevant for that metric. For example,IOUMatcher
is only valid for division metrics ifone_to_one=True
.Types of Changes
What types of changes does your code introduce? Delete those that do not apply.
Which topics does your change affect? Delete those that do not apply.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.