7 routes42 sections324 units

Unit 5.7 · about 3 h

166 / 324

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.

  • measure

You can now

  • 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

  • Learning curves, error taxonomies and slice support counts

Study, in this order

2 steps

  1. Validation curves and learning curves
    scikit-learn - model selection and evaluation route

    Sections 3.5.1 (validation_curve and ValidationCurveDisplay: high train with low validation means overfit) and 3.5.2 (learning_curve and LearningCurveDisplay: Naive Bayes flat and low versus SVM converging)

    Depth · Skip the scalability example. The digits snippet numbers in Reproduce are your check.

  2. Slice, error and data-size requirements
    Classical 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 \(n=3\) 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.

Reproduce closed-book

Closed-book, run 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 \(n\) with a closing gap. Then tabulate one error slice with support counts.

Traps

  • 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.

Practice

scikit-learn learning-curve digits check

Reproduce the Naive Bayes versus SVC learning-curve comparison on digits and state the bias or variance reading for each panel

Match the qualitative pattern (flat low Naive Bayes, converging SVM), not pixel values. Then repeat on your own data with support-counted slices.

Self-test

  1. Train 1.00 with validation 0.82 at small \(n\), then 1.00 with 0.93 at full \(n\). Diagnosis?

  2. Both curves sit flat at 0.70 from 10% to 100% of data. Next step?

  3. Slice A is 2/3 wrong. Slice B is 40/400 wrong. Which finding is stronger?

  4. Why slice by source or time rather than by low model confidence?

Completion criterion

Stop when

Your curve reading names bias or variance with the numbers that show it, and every slice claim carries \(n\) and an interval.

Mark passed, then open 5.8 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • scikit-learn - model selection and evaluation route
    scikit-learnprimarycourse
    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
    Roadmap-Finalreferenceassessment
    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
    James, Witten, Hastie, Tibshirani and Taylorrequiredtheory
    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
    D2L authorssupporttheory
    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
    Deep-MLoptionalpractice
    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
    SciPy developersreferencereference
    Work the notebooks linked from this page: Tutorial 3 (The Bootstrap) with scipy.stats.bootstrap, including paired=True, and Tutorial 2b (Paired-Sample Permutation Tests) with permutation_test and permutation_type='samples'. Keep one resampling index stream across compared models.
  • El-Yaniv and Wiener - On the Foundations of Noise-free Selective Classification
    JMLRreferencereference
    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.

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels