Use a time split for a future event

Return to the home row after each number or separator. · 174 words

A museum wants to predict whether a visitor will return within 30 days. Each record is made at a visit and contains earlier visit counts, membership status, and visit channel. The label, or target, becomes known only after the 30-day window. Split by time: January through May forms training data for learning, June is validation data for choosing settings, and July and August form test data for a final check. This matches deployment, when forecasting an event that has not happened. Every input must stop at the record's cutoff date.

Consider an online store that predicts whether a shopper will reorder within 30 days. For a January 20 order, inputs can include prior order counts and coupon use through January 20. The label records the next 30 days. Train on older orders, validate on later orders, and keep the newest period for testing. A random split is unsafe because it can train on a future order and test on an earlier one. That gives the model future information and yields an overly optimistic evaluation.

Check your recall

In the museum example, which periods are used for training, validation, and test, and what information may a training feature use?

Check your answer

Use January through May for training, June for validation, and July and August for testing. A training feature may use only information available by that record's cutoff date, not events from its future 30-day label window.

Sources and credits

Original KeyTouch lesson. Background reading · Google · Machine Learning Crash Course.