Skip to content

Structuring an analysis you can defend

Verifiedintermediate7 min

A folder layout and a set of habits that keep a computational project reproducible.

Judges ask "could you run this again and get the same numbers?" more often than students expect. Structure makes the answer yes.

project/
  data/raw/        # never edited, ever
  data/processed/  # generated by scripts, safe to delete
  notebooks/       # exploration
  src/             # functions that do the work
  results/         # figures and tables, all generated
  README.md        # how to run it, start to finish

Four habits that matter more than the layout:

  1. Raw data is read-only. Every cleaning step is code, not a manual edit. If you fix a typo by hand in a spreadsheet, that fix is invisible and unrepeatable.
  2. Set a random seed and record it. Unseeded shuffles mean your results change every run.
  3. Scripts run top to bottom. A notebook that only works if you execute the cells in a particular order is not reproducible.
  4. Pin your versions. pip freeze > requirements.txt takes five seconds and answers a question you cannot otherwise answer six months later.

Then delete data/processed/ and results/, re-run everything, and check the figures come back identical. Do this at least a week before the fair.

More in Programming