promptdojo_

Bias, variance, and leakage in plain code — step 7 of 7

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Build the leakage hunter. For each feature (f1 and cheat), compute the gap: abs(mean among label-1 rows minus mean among label-0 rows), rounded to 2 places. Print features sorted by gap (largest first, one 'name gap' line each), then a 'suspicious:' line naming the biggest. A feature whose per-class means separate this cleanly is the label leaking through.

full-screen editor opens — close anytime to keep reading.