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

Saving all attributes of LabelModel #1463

Merged
merged 2 commits into from
Sep 20, 2019
Merged

Saving all attributes of LabelModel #1463

merged 2 commits into from
Sep 20, 2019

Conversation

paroma
Copy link
Contributor

@paroma paroma commented Sep 17, 2019

Description of proposed changes

Saving and loading LabelModel via attribute __dict__ pickling. This saves out parameters other than weights like mu that are needed to methods like predict() without having to call fit() with the loaded model

Related issue(s)

Fixes #1460

Test plan

Edited test for save() and load() to check predictions are the same for saved and loaded model

Checklist

  • I have read the CONTRIBUTING document.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have run tox -e complex and/or tox -e spark if appropriate.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Sep 17, 2019

Codecov Report

Merging #1463 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1463      +/-   ##
==========================================
+ Coverage   97.58%   97.58%   +<.01%     
==========================================
  Files          55       55              
  Lines        2029     2032       +3     
  Branches      334      334              
==========================================
+ Hits         1980     1983       +3     
  Misses         22       22              
  Partials       27       27
Impacted Files Coverage Δ
snorkel/labeling/model/label_model.py 95.8% <100%> (+0.04%) ⬆️

Copy link
Member

@bhancock8 bhancock8 left a comment

Choose a reason for hiding this comment

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

👌

@paroma paroma merged commit 7c400b1 into snorkel-team:master Sep 20, 2019
@paroma paroma deleted the saving branch September 20, 2019 02:23
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.

Error loading a saved LabelModel and using it to predict
2 participants