Data science · Modelling and SQL — from a number to a decision

Leakage — how a model gets 99% and helps nobody

Leakage is the failure that looks like success, and it is the most common reason a model that validated well does nothing in production. This builds a dataset with no signal whatsoever and extracts 69% accuracy from it by encoding a feature on the wrong rows, then writes the join that quietly counts events from after the prediction date and the as-of join that fixes it.

26 min read Full lesson in the app Patterns: target-leakage, as-of-join, time-based-split

What you'll be able to do

Before this: the-two-errors-and-the-size-of-the-test

The rest of this lesson is in the app

Leakage is the failure that looks like success, and it is the most common reason a model that validated well does nothing in production. This builds a dataset with no signal whatsoever and extracts 69% accuracy from it by encoding a feature on the wrong rows, then writes the join that quietly counts events from after the prediction date and the as-of join that fixes it. This walkthrough runs about 26 minutes, with runnable code you can edit and re-run as you read.

Continue in ChannelPulse

The first module of every track is free to read on the web — see what's open in Data science.