Unit 7 of 10 · about 3 hours · measure
Learning curves, error taxonomies and slices
Aggregate scores average away the slice that fails. Curves say whether to buy data; slices say where the model is wrong.
You'll be able to
- Read training and validation curves to separate bias (more data will not help) from variance (more data may help).
- Build an error taxonomy with slice support counts and refuse conclusions a slice cannot support.
- Turn the worst supported slice into a testable hypothesis with a follow-up slice.
Covers
Read
In this order, only the parts listed
0 of 2 done
- Validation curves and learning curvesscikit-learn - model selection and evaluation route
Sections 3.5.1 (
validation_curveandValidationCurveDisplay: high train with low validation means overfit) and 3.5.2 (learning_curveandLearningCurveDisplay: Naive Bayes flat and low versus SVM converging)Skip the scalability example. The digits snippet numbers in Reproduce are your check.
- Slice, error and data-size requirementsClassical ML Scientific Investigation
Milestones B (record predictions and errors per item), C (prescribed ablations and learning/data-size probes) and E (subgroup, time and source slices with paired uncertainty and practical significance)
Focus on
- Both scores low means bias (capacity or features); train high with validation low means variance. Validation above train is rare and usually means the two are measured differently: augmentation or dropout at train time, an easier or tiny validation split, or leakage.
- Never tune on the validation curve's peak and report that peak. The curve diagnoses; a fresh split evaluates.
- Every slice needs its support count beside the rate: 100% error on is a hint, not a finding.
- Slice by deployment axes (source, time, subgroup), not by the model's own confidence alone, or the taxonomy confirms itself.
Common mistakes · 3
- Concluding that more data will fix flat converging curves. The Naive Bayes panel shows both scores stuck low: capacity, not data.
- Slicing until a bad slice appears, then reporting it raw. Unplanned slices are multiple comparisons, so pre-register slices or adjust.
- Averaging slice metrics without support weights while claiming deployment impact. Impact is rate times slice share.
Try it yourself
Closed-book, before checking anything
learning_curve for LogisticRegression(max_iter=2000) on digits with train_sizes [0.1, 0.5, 1.0] and cv=3 (119, 599 and 1198 training rows) and read the regime. Reference run: train 1.00 at every size, validation 0.823, 0.918, 0.926, so variance at small with a closing gap. Then tabulate one error slice with support counts.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Train 1.00 with validation 0.82 at small , then 1.00 with 0.93 at full . Diagnosis?Answer
Variance-dominated with a closing gap: more data helped and the model still memorizes train. Some overfit remains, so try regularization, not just data.
2.Both curves sit flat at 0.70 from 10% to 100% of data. Next step?Answer
Bias: capacity or features are the ceiling. More of the same data will not move it, so change the model or the representation.
3.Slice A is 2/3 wrong. Slice B is 40/400 wrong. Which finding is stronger?Answer
B: 10% error on has a tight interval, while 67% on is noise. Report both with counts and intervals.
4.Why slice by source or time rather than by low model confidence?Answer
Confidence slices re-select the model's own failures and cannot show where deployment breaks. Source and time slices test the deployment axes.
Practice
- scikit-learn learning-curve digits check
Reproduce the Naive Bayes versus
SVClearning-curve comparison on digits and state the bias or variance reading for each panelMatch the qualitative pattern (flat low Naive Bayes, converging SVM), not pixel values. Then repeat on your own data with support-counted slices.
You're done when
Your curve reading names bias or variance with the numbers that show it, and every slice claim carries and an interval.
Only when you can do this without notes.
Leads to
Notes
Resources · 2 for this unit, 5 more in the section
- scikit-learn - model selection and evaluation routescikit-learn · primary
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 InvestigationRoadmap-Final · reference
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 testingJames, Witten, Hastie, Tibshirani and Taylor · required
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 ShiftD2L authors · support
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 problemsDeep-ML · optional
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 tutorialsSciPy developers · reference
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 ClassificationJMLR · reference
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.