Unit 5.10 · about 3 h
169 / 324Ablations, negative controls, threats to validity and decision memos
A higher score is not evidence until cheaper explanations are ruled out. Ablations and negative controls turn a leaderboard into a finding.
- measure
You can now
- Design the smallest ablation matrix that separates data, feature, capacity and evaluation explanations.
- Keep a null control (dummy baseline, shuffled-target run) that must fail for the conclusion to mean anything.
- Write a narrow decision memo that survives a small move in the best score.
Covers
- Ablations, negative controls and failure injection
- Threats to validity and narrow decision memos
Study, in this order
3 steps
- Ablations, failure injection and defenseClassical ML Scientific Investigation
Milestones C (prescribed ablations under one controlled search budget), D (inject target-proxy, duplicate, future-feature, global-preprocessing and test-tuned-threshold failures; audits must fail at the right boundary; preserve failed runs), E (effects with paired uncertainty and multiplicity) and the Design-defense questions (baseline, metric-threshold match, what each ablation isolated, the largest remaining shift)
- Dummy estimators as null controlsscikit-learn - model selection and evaluation route
Section 3.4.8 (
most_frequent,stratifiedanduniformbaselines that ignore the features; the worked example sets the bar the real model must clear) - Common pitfalls: leakage patterns that audits must catchscikit-learn - model selection and evaluation route
Section 12.2 (split-first discipline, scaler-in-pipeline, the
SelectKBest-on-all-data pattern scoring 0.76 on random labels versus 0.50 split-first)
Focus on
- Change one mechanism per cell with data, splits and evaluation frozen. Record every variant and failure, not just the winner.
- Every claim needs a null that must fail: a dummy baseline, a shuffled-target run, or a seeded leak the audit must catch.
- Tune all compared families under one controlled search budget. Unequal tuning is a confound, not a result.
- Write the memo narrow: decision, evidence, uncertainty, threats, and what would change the call. A conclusion that breaks on a 0.005 score move is not a conclusion.
Reproduce closed-book
SelectKBest leakage pattern (0.76 leaked on random labels versus 0.50 split-first), then seed one failure of your choice (global scaling before the split) on a small pipeline and show the split-first pipeline removing it beside a dummy baseline.Traps
- Ablating by removing a component and retuning everything else freely. Retuning confounds the comparison; freeze the budget and the protocol.
- Keeping only the winning run. Without the failed variants and the search history, the winner's curse makes the margin a lie.
- A negative control that passes. If the dummy or shuffled-target run looks good, the evaluation is broken, not the model brilliant.
Practice
Seeded-leak audit drill (`SelectKBest` pattern)
Section 12.2.2: reproduce the leaked 0.76 on random labels, then the split-first 0.50, on your own data with one seeded leak of your choice
Add a dummy-baseline null control and keep the failed run in your log. That log is the memo's appendix.
Self-test
-
Removing feature set
Xdrops accuracy 0.02 with a paired interval of[-0.01, 0.05]. What do you conclude?Nothing aboutXyet: the interval covers zero and the effect is noise-sized. Report the null result with its interval instead of claimingXis useless or useful. -
On a balanced binary task, your shuffled-target control scores 0.76. What is broken?
The evaluation leaks: with random labels nothing beats chance, 0.50 here. Audit preprocessing scope, duplicates and target-derived features before any modeling claim. -
Model A had 3x the tuning budget of model B and wins by 0.01. Decision?
No decision: tuning effort confounds family quality. Re-run under one controlled budget with paired uncertainty, then decide. -
What makes a decision memo narrow?
One decision, the exact evidence for it, uncertainty and threats against it, and the pre-stated tripwire (score move, slice failure, shift) that would reverse it.
Completion criterion
Stop when
A seeded leak fails your audit at the right boundary, every ablation cell carries paired uncertainty, and your memo states the tripwire that would reverse the decision.
Mark passed, then open 1.1 Only mark this when you can do it without notes.Leads to
- 5.6 Paired bootstrap, permutation tests and multiplicity Give every ablation cell paired uncertainty.
- 1.7 Baselines: constant, frequency, heuristic, last-value and simple learned Return stronger baselines as standing controls.
Comes after
- 1.8 Snapshots, lineage, pipeline serialization and serving parityUse frozen lineage and parity as the base for ablations and controls.
- 5.6 Paired bootstrap, permutation tests and multiplicityFold the paired interval into the ablation runner.
- 5.7 Learning curves, error taxonomies and slicesTest the slice hypothesis with controls.
- 5.8 Permutation importance and partial dependenceTest an important feature by removing it under controls.
- 5.9 Covariate, label and concept shift, drift and label delayProve the shift response with ablations and controls.
Resources for this unit
- scikit-learn - model selection and evaluation route Follow Cross-validation, Hyperparameter tuning, Decision threshold tuning, Metrics and scoring, Probability calibration, Validation curves, Permutation importance and Common Pitfalls. Retain raw predictions and independently hand-check central metrics.
- Classical ML Scientific Investigation Use Core requirements, architecture constraints, Milestones A-F and failure injection as the standard for end-to-end evidence. The full project remains a later capstone route.
Also in this section
- ISLP - resampling and multiple testing Use Chapter 5 and the relevant selection-history parts of Chapter 13 with their Python labs. Connect resampling to uncertainty and multiplicity without repeating the full statistics stage.
- D2L - Environment and Distribution Shift Read 4.7, then construct one controlled covariate, label and concept shift. Record what changes, which signal detects it and what response the evidence supports.
- Deep-ML candidate - evaluation problems After the platform admission check, use at most one of 18 K-Fold CV, 260 Expected Calibration Error, 276 ROC, 277 AUC or 840 Stratified K-Fold. Hand-checked local metrics remain the evidence.
- SciPy - Resampling and Monte Carlo methods tutorials Work the notebooks linked from this page: Tutorial 3 (The Bootstrap) with
scipy.stats.bootstrap, includingpaired=True, and Tutorial 2b (Paired-Sample Permutation Tests) withpermutation_testandpermutation_type='samples'. Keep one resampling index stream across compared models. - El-Yaniv and Wiener - On the Foundations of Noise-free Selective Classification Read the Abstract and Section 2 (Preliminary Definitions: Definitions 1 and 2 for coverage and selective risk) for the risk-coverage tradeoff. Stop before the noise-free learning bounds.