Skip to content

Robustness checks and the last look

Before the final test score, pressure-test the model against seeds, fold schemes, leaks and weak slices. Then take the one honest look, and decide what to do with it.

Applied ~12 min10 steps

What runs in CodeSplash

You will be able to

  • Run seed, fold scheme, leakage, sensitivity and slice checks, and read each one
  • Follow the full loop from baseline to registration
  • Decide what to do when the test score disappoints

Read first

01

The whole loop

Read

By now you know the order.

  1. Baseline, then a glass box, then a strong learner.
  2. Compare, paired, on the same folds.
  3. Tune the one that earned it.
  4. Threshold and calibration, for the decision.
  5. Explain: does it use what it should?
  6. Robustness and leakage: this lesson.
  7. Test once.
  8. Register.

Everything through step 6 uses folds. Only then do you open the lock.

02

Five questions

Read

Robustness asks five things of a run:

SectionThe question
Seed stabilityDoes the score or the importance order move with the seed?
Fold schemeDoes random folding beat grouped or time-ordered folds?
Leakage scanDoes one feature nearly determine the target?
Hyperparameter sensitivityIs the setting on a knife edge?
Worst slicesWhere is the model much worse than average?

The top of the report gives a verdict: No problems found, Worth a closer look or Problems found.

03

Which is the alarm?

Predict

Predict first

Three findings on a model that will score new customers. Which one should stop you from shipping today?

Seeds move the AUC a little, less than the fold SDRandom folds beat grouped folds by a lotThe worst slice has an error 30% above average
Reveal

Random folds beating grouped folds by a lot. It means the score you've been comparing on is inflated, because the model recognizes customers it has already seen. A small seed effect is normal. A weak slice is worth looking into, but it's exploratory: many slices were compared, so some look bad by chance.

04

Slices and many looks

Read

Worst slices scans category levels, quartiles of numeric features and missing values, on out-of-fold rows. It's a search, so its worst findings are partly luck. Treat it as a place to look, with 95 % interval in hand, and not as a result.

If a slice matters for its own sake, such as a group with legal protection, decide that beforehand and check it directly. Fairness does this for groups you name.

05

See how a good score can lie

Explore

Pick each entry in The pipeline, and look at which symptom you'd need to see it. Which would Leakage scan catch? Which would Fold scheme catch? Which would neither catch?

DExplorable · Leakage detective

Why does a model that scores brilliantly in testing fail on real data?

Read the pipeline on the left. Will its cross-validation score overstate real-world accuracy by more than 6 points?

How sure?

The pipeline

200
60
Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

06

Opening the lock

Read

Say Pima's forest looks right: cross-validated AUC 0.835 and test AUC 0.793. A logistic model: 0.857 and 0.810.

Test below cross-validation is normal, especially after a search. Report the test number, with how many runs touched the test set.

If it's far below, don't tune against it. Look for why, on the folds: leakage, a shifted test period, or too much selection. Any fix means the test set has been spent, so you'll need new rows for a fresh look.

07

Your checklist

Reflect

Think of a model you've shipped or reviewed. Which of the five checks would have changed the decision? Which of steps 1 to 8 did you skip? If a colleague asked how many runs touched the test set, could you tell them?

08

Check your understanding

Checkpoint

Check yourself

Across seeds, CV AUC varies far less than the fold-to-fold SD, and Kendall τ (importance) is high. What's the right reading?

Show the answer

Answer: a

That's what you hope to see. A low τ would tell you not to over-read the importance order.

Check yourself

You test a model trained with random folds on grouped folds, and Random folds better by is large and red. What's the next step?

Show the answer

Answer: a

If the model will meet new entities, grouped folds are what match. The random-fold score overstates performance.

Check yourself

Your test AUC comes out well below cross-validation. A colleague suggests retuning with a focus on those rows. Why not?

Show the answer

Answer: b

Investigate on folds. If you must change the model, get fresh rows for the next honest look.

Check yourself

When should you score the locked test set?

Show the answer

Answer: c

Every earlier look lets the test rows help choose, and so the number stops being an honest estimate.

09

Run it

In the app

Open your best run's Robustness tab. Set Seeds, Group folds by or Order folds by time, and Hyperparameters, then press Run checks. Read the verdict and each section. When it's clean, press Register on the run to send it to Models, as the walkthrough does with a model of {{target}}.

10

Recap

Recap
  • Pressure-test the model on folds: seeds, schemes, leaks, sensitivity and slices.
  • The fold-scheme gap is the alarm to take most seriously. Worst slices are a place to look.
  • Test once, report it as it is, and don't tune against it.

Concepts in this lesson