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

Make preds and probs optional in Scorer.score() #1441

Merged
merged 2 commits into from
Sep 4, 2019
Merged

Make preds and probs optional in Scorer.score() #1441

merged 2 commits into from
Sep 4, 2019

Conversation

bhancock8
Copy link
Member

@bhancock8 bhancock8 commented Sep 4, 2019

Description of proposed changes

Make preds and probs optional for Scorer.score(), since it's just a wrapper around individual metric computation calls (usually via metric_score), and those metrics raise an Exception if they've been passed a None where they expected values. This change removes boilerplate from score() and loses no protection.

Related issue(s)

Fixes #1417

Test plan

Add new test confirming that Scorer.score() can be called with or without probs.

Checklist

Need help on these? Just ask!

  • I have read the CONTRIBUTING document.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@henryre henryre left a comment

Choose a reason for hiding this comment

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

@bhancock8 especially now that the inputs can be optional, can we improve the doc string? e.g. "Probabilities (floats)" doesn't tell me anything.

@codecov
Copy link

codecov bot commented Sep 4, 2019

Codecov Report

Merging #1441 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1441   +/-   ##
=======================================
  Coverage   97.54%   97.54%           
=======================================
  Files          55       55           
  Lines        1996     1996           
  Branches      327      327           
=======================================
  Hits         1947     1947           
  Misses         22       22           
  Partials       27       27
Impacted Files Coverage Δ
snorkel/analysis/metrics.py 100% <ø> (ø) ⬆️
snorkel/analysis/scorer.py 100% <ø> (ø) ⬆️

Copy link
Member

@henryre henryre left a comment

Choose a reason for hiding this comment

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

Great looks good to me!

@bhancock8 bhancock8 merged commit 0d9f957 into master Sep 4, 2019
@bhancock8 bhancock8 deleted the fix_1417 branch September 4, 2019 21:05
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.

Make golds, preds, probs optional in Scorer.score()
2 participants