Complete Assignment 1: Sampling and Reproducibility#107
Complete Assignment 1: Sampling and Reproducibility#107tanveerrouf wants to merge 0 commit intoUofT-DSI:mainfrom
Conversation
|
Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process. |
4456a63 to
1215ce6
Compare
|
Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process. |
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Added np.random.seed(42) to make results reproducible. Documented the four sampling stages in the contact tracing simulation.
What did you learn from the changes you have made?
Reproducibility requires knowing where randomness lives. Multiple sampling layers (individual, event, simulation) interact in ways that are not obvious without fixing the seed.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Considered random.seed() but NumPy functions need np.random.seed(). Setting the seed inside the loop would have broken reproducibility.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
Git divergence issue. Solved with git pull --rebase to align local work with the remote.
How were these changes tested?
Ran with 10, 100, and 1000 repetitions. With the seed, results are identical every time. Without it, values vary wildly, which in turn confirms the fix works.
A reference to a related issue in your repository (if applicable)
NA
Checklist