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

Fixes prediction saving for models with Set output #2211

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

geoffreyangus
Copy link
Collaborator

This PR fixes prediction saving for Set features (#2199).

Prior to this change, the list of probabilities crossing threshold was converted to np.array with no dtype specified. If any of the probabilities crossed the threshold, the np.array generated would be the dtype of the probability, typically the dtype float32 commonly used by PyTorch. However, if NO probabilities crossed the threshold, the np.array generated would be dtype float64, which is the default for np.array. This PR ensures that the dtype of the generated numpy array is float32.

@github-actions
Copy link

github-actions bot commented Jun 29, 2022

Unit Test Results

       6 files  +    1         6 suites  +1   2h 35m 28s ⏱️ + 35m 17s
2 911 tests +    3  2 865 ✔️ +    3    46 💤 ±  0  0 ±0 
8 733 runs  +177  8 591 ✔️ +154  142 💤 +23  0 ±0 

Results for commit b4531af. ± Comparison against base commit 236cf54.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@abidwael abidwael left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together Geoffrey! Left a comment about using text_feature, but otherwise should be good.

tests/integration_tests/test_postprocessing.py Outdated Show resolved Hide resolved
@geoffreyangus geoffreyangus marked this pull request as ready for review June 30, 2022 20:10
@tgaddair tgaddair linked an issue Jul 5, 2022 that may be closed by this pull request
@justinxzhao justinxzhao merged commit a72cde2 into master Jul 6, 2022
@justinxzhao justinxzhao deleted the fix-empty-set-probs-dtype branch July 6, 2022 02:40
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.

model.predict() fails on goemotions v0.5.3
3 participants