Why a Model with No Predictive Power Can Score 90% Accuracy

· Source: Towards AI - Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics · Depth: Intermediate, long

Summary

The article demonstrates how look-ahead bias can inflate model accuracy, specifically when outcome variables span multiple future observations and overlap between training and test sets. It simulates a market with no predictive edge, where daily returns are independently drawn from a bell curve centered on zero. A model predicting 20-day cumulative returns achieves 90.5% accuracy using a one-nearest-neighbor classifier and walk-forward validation with no gap. This inflated score arises because neighboring training and test labels share 19 of 20 underlying returns, leading to 91% agreement between adjacent labels. Applying a "purging" fix by introducing a 20-day gap between training and test sets in TimeSeriesSplit eliminates this overlap, reducing accuracy to 50.3%, which aligns with the expected 50% for data with no signal. The article highlights that this 40.2 percentage point overstatement is due to leakage.

Key takeaway

For Machine Learning Engineers building time-series models, if your outcome variable spans multiple future observations, you must implement purged cross-validation. Failing to introduce a sufficient gap between training and test sets will lead to look-ahead bias, artificially inflating your model's reported accuracy by potentially over 40 percentage points. Ensure your validation strategy prevents any training label from reaching into the test period to avoid deploying models that appear performant but lack true predictive power.

Key insights

Look-ahead bias from overlapping outcome windows can inflate model accuracy significantly, even with no predictive power.

Principles

Method

To prevent look-ahead bias from overlapping outcome windows, introduce a "purging" gap (equal to the outcome horizon) between training and test sets in walk-forward validation.

In practice

Topics

Best for: Machine Learning Engineer, Data Scientist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Towards AI - Medium.