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

Persist intermediate data to avoid non-determinism caused by Spark lazy random evaluation #1676

Merged
merged 7 commits into from
Mar 18, 2022

Conversation

simonzhaoms
Copy link
Collaborator

@simonzhaoms simonzhaoms commented Mar 17, 2022

Description

The bug is reported by Bhrigu. Due to Spark lazy evaluation, random filtering without replacement in spark_stratified_split() will result in duplicate rows in both training and test data.

This PR persists the intermediate data to avoid the issue caused by Spark lazy evaluation.

See also:

Related Issues

Checklist:

  • I have followed the contribution guidelines and code style for this project.
  • I have added tests covering my contributions.
  • I have updated the documentation accordingly.
  • This PR is being made to staging branch and not to main branch.

@codecov-commenter
Copy link

Codecov Report

Merging #1676 (4dfb783) into staging (17204b1) will increase coverage by 0.12%.
The diff coverage is 100.00%.

❗ Current head 4dfb783 differs from pull request most recent head de6cbf9. Consider uploading reports for the commit de6cbf9 to get more accurate results

@@             Coverage Diff             @@
##           staging    #1676      +/-   ##
===========================================
+ Coverage    23.09%   23.21%   +0.12%     
===========================================
  Files           88       88              
  Lines         9101     9101              
===========================================
+ Hits          2102     2113      +11     
+ Misses        6989     6988       -1     
Flag Coverage Δ
nightly ?
pr-gate 23.21% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
recommenders/datasets/spark_splitters.py 87.27% <100.00%> (ø)
recommenders/evaluation/spark_evaluation.py 87.05% <0.00%> (+0.44%) ⬆️

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 17204b1...de6cbf9. Read the comment docs.

Copy link
Collaborator

@miguelgfierro miguelgfierro left a comment

Choose a reason for hiding this comment

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

LGTM

@simonzhaoms simonzhaoms merged commit d43e2c1 into staging Mar 18, 2022
@simonzhaoms simonzhaoms deleted the simonz/spark_stratified_split-fix2 branch March 18, 2022 05:26
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