A random split can mix later observations into training and produce a misleading evaluation. For ordered data, evaluate on later observations and fit transformations using only each training partition.
Educational and simulation content only. This is not financial advice, intermediation or an investment recommendation. Historical results do not guarantee future results.
Where leakage appears
Suppose a feature is standardized using the mean and standard deviation of the entire dataset, including the test period. Even if a model never receives a future date, the transformation has incorporated information from that period. Fit the transformation on training data, then apply the fitted transformation to the test data.
A chronological split reduces leakage, but does not eliminate every form. A label that depends on prices over the next five days can cross the split boundary. Exclude observations with overlapping label horizons according to the label design.…