Practice question · Sort into groups
Sort each practice by its effect on reproducibility.
Groups: Makes the result reproducible · Leaves the result irreproducible
- Recording the exact library versions used
- Setting a fixed random seed before the simulation
- Committing the analysis code to version control
- Editing the script by hand between runs without keeping copies
- Relying on an unseeded random number generator
Hints
- Ask whether someone else could obtain the identical number tomorrow.
- Randomness is not the enemy of reproducibility, uncontrolled randomness is.
Show the answer
Makes the result reproducible: Committing the analysis code to version control, Setting a fixed random seed before the simulation, Recording the exact library versions used
Leaves the result irreproducible: Editing the script by hand between runs without keeping copies, Relying on an unseeded random number generator
Why
Version control, a fixed seed and recorded versions together pin down exactly what produced a number. Untracked edits and unseeded randomness make the result unrepeatable even by its own author.
Practise Reproducibility and Good Practice
The app has 5 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.
More questions on Reproducibility and Good Practice
- A NumPy vectorised operation and an equivalent Python loop compute identical results, and the vectorised one…
- A colleague sends a script and the number it printed. Select everything you still need before that result can…
- Vectorising usually gives a large speed-up, but sometimes almost none. Why does replacing a loop with an…
- Two runs of the same simulation with the same fixed seed and the same library versions should produce…
- Complete the purpose of a test suite.
- A test suite contains 40 unit tests, of which 36 passed before a change. The change makes 3 previously…
- Order the steps of putting an analysis on a reproducible footing.