8000 Demonstrate annotating structured metadata to classification functions by cthoyt · Pull Request #29 · AstraZeneca/rexmex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

Demonstrate annotating structured metadata to classification functions #29

Merged

Conversation

cthoyt
Copy link
Contributor
@cthoyt cthoyt commented Dec 8, 2021

Summary

This PR demonstrates a potential solution to #28 in a pilot applied to classification metrics. It could be extended in a future pull request to other branches of the package.

  • Code passes all tests
  • Unit tests provided for these changes
  • Documentation and docstrings added for these changes

Changes

  • Add an annotate decorator that adds some structured information to classification functions
  • Add tests to make sure the data is accessible
  • Add unit test to ensure all classification functions are annotated (1afd68b)
  • Annotate all classification functions

Future

Before finalizing this PR, I had also used the annotate function to make a registry of functions. This could be used to make the generation/maintenance of the ClassificationMetricSet much easier, but I'd save that for a different PR.

tests/unit/test_metrics.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link
codecov-commenter commented Dec 8, 2021

Codecov Report

Merging #29 (eaf835d) into main (e3db3f6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   99.74%   99.76%   +0.01%     
==========================================
  Files          16       16              
  Lines         781      847      +66     
==========================================
+ Hits          779      845      +66     
  Misses          2        2              
Impacted Files Coverage Δ
rexmex/metrics/classification.py 100.00% <100.00%> (ø)
rexmex/utils.py 100.00% <100.00%> (ø)
tests/unit/test_metrics.py 100.00% <100.00%> (ø)

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 e3db3f6...eaf835d. Read the comment docs.

This will make it easier to use a registry pattern in the future (i.e., to auto-group things, like what's being done manually in the MetricSets)
@benedekrozemberczki
Copy link
Contributor
7C02

Thank you @cthoyt!

@benedekrozemberczki benedekrozemberczki merged commit c189e5e into AstraZeneca:main Jan 3, 2022
@cthoyt cthoyt deleted the structured-metric-metadata branch January 3, 2022 14:59
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.

3 participants
0