WRITE · TRACE · UNDERSTAND
Purge a gap before a temporal validation window
Implement temporal_split(times,start,end,gap) returning (train_indices,validation_indices), preserving row order.
Read lesson: Purge a gap before a temporal validation window →
Your experiment
Implement temporal_split(times,start,end,gap) returning (train_indices,validation_indices), preserving row order. Train if t<start-gap; validate if start<=t<=end. Require start<=end and gap>=0.
Python runs in your browser. Your draft stays on this device.
What to look for
A temporal split must be combined with point-in-time feature joins and train-only preprocessing. Time order alone does not prevent using a feature published after the prediction timestamp.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
