← Back to Curriculum
Training & Evaluation·25 min·Intermediate
🧪

Experimentation

Baselines, ablations, and reproducibility

Science demands proof, not just results. Learn to run experiments that are fair, repeatable, and actually convincing.

Before We Begin

What we are learning today

A result without context is just a number. Did the model improve because of your clever new feature, or because you got lucky with the random seed? This lesson teaches the scientific method applied to ML. We start with baselines—simple models that set the floor—then use ablation studies to isolate which components actually help. We finish with reproducibility: version-controlling data, fixing random seeds, and documenting every choice so anyone can verify your work.

How this lesson fits

Building a model is one thing; training it well and knowing whether it actually works is another. This module covers the engine room of ML: how optimization drives learning, how bias and variance shape model behavior, how to pick the right scoreboard, and how to run experiments you can trust.

The big question

How do we train a model effectively, measure its true performance, and make sure our results are not just a fluke?

Trace a gradient descent step and explain how the learning rate controls itDiagnose overfitting vs. underfitting from training curvesChoose the right evaluation metric for a given problemDesign a fair experiment with baselines and reproducibility

Why You Should Care

The ML community has a reproducibility crisis. Papers report results that no one can replicate. Teaching students to run clean experiments from the start builds scientific integrity and saves countless hours of debugging in the future.

Where this is used today

  • Tech companies: running A/B tests before deploying model changes
  • Research labs: ablation tables in every top ML paper
  • Startups: comparing a fancy model against a simple baseline to justify engineering cost

Think of it like this

Think of a science fair project. You would never claim "my plant grew taller because of the music I played" unless you had a control plant with no music, repeated the experiment multiple times, and wrote down every step. ML experimentation follows the exact same logic: control, compare, repeat, document.

Easy mistake to make

A single good result does not prove anything. Without a baseline comparison and repeated runs, you cannot tell if the improvement is real or just noise from a lucky data split.

By the end, you should be able to say:

  • Explain why every experiment needs a baseline and what makes a good one
  • Design an ablation study that isolates the contribution of a single component
  • List practical steps for reproducibility: random seeds, version control, environment logging
  • Distinguish between a lucky result and a robust improvement

Think about this first

Your classmate says their model got 92% accuracy. What is the first question you should ask before being impressed?

Words we will keep using

baselineablationreproducibilityrandom seedcontrolstatistical significance

Results Without Context Are Just Numbers

Did the model improve because of your clever new feature, or because you got lucky with the random seed? Experimentation is the scientific method applied to ML: control, compare, repeat, document.

BaselineA simple model that sets the floor. If your fancy model can't beat it, the complexity isn't worth it.
AblationRemove one component at a time to see which parts actually contribute.
ReproducibilityFix seeds, version data, log everything. If no one can replicate it, it didn't happen.

Interactive: A/B Test Simulator

Group A is the control. Group B gets a treatment with a true effect. Adjust the effect size and sample size to see when the difference becomes statistically significant.

\u25cf Control (A): \u03bc = 51.1\u25cf Treatment (B): \u03bc = 52.2
p-value: 0.3495\u2717 Not significant
Effect size: 1.07
z-score: 0.94

Ablation Studies

An ablation table removes components one at a time and measures the impact. It's the ML equivalent of "which ingredient makes this recipe work?"

ConfigurationAccuracyΔ from full model
Full model (BERT + features + augmentation)94.2%
− data augmentation92.1%−2.1%
− custom features93.5%−0.7%
− BERT (use TF-IDF instead)87.3%−6.9%
− all three (baseline)85.0%−9.2%

BERT contributes the most (\u22126.9%), followed by augmentation (\u22122.1%). Custom features add only 0.7% \u2014 maybe not worth the engineering cost.

Reproducibility Checklist

Fix random seedsSet numpy, torch, and Python seeds so results are deterministic
Version your dataUse DVC or hash your dataset so the same data can be recovered
Log hyperparametersUse tools like MLflow or W&B to record every setting
Pin dependenciesFreeze requirements.txt so library updates don't silently change results
Share codePush to a repo with clear instructions. If it only works on your laptop, it doesn't work.
Report varianceRun 5–10 times and report mean ± std. A single run is anecdotal.

p<0.05p < 0.05 does not mean "definitely real." With 20 experiments at α=0.05\alpha=0.05, on average one will be a false positive purely by chance. Correct for multiple comparisons or pre-register your hypothesis.