A data scientist is building a GPU-accelerated model to forecast next week's demand from historical daily sales held in a cuDF DataFrame with a datetime column. To estimate how the model will perform on genuinely future data, how should the train and test sets be split?
- AUse the earliest dates for training and the most recent dates for testing, splitting on a cut-off timestamp so the test period strictly follows the training period. Correct
- BShuffle all rows randomly and assign 80 per cent to training and 20 per cent to testing, so both sets cover the full date range evenly.
- CApply stratified sampling on the daily_sales value so that the train and test sets share the same distribution of sales magnitudes.
- DHold out every seventh day as the test set so that each weekday appears in both training and testing in equal proportion.
Why A is correct: Splitting on a chronological cut-off keeps all training rows earlier than every test row, which mirrors the real deployment scenario of predicting the future from the past and prevents look-ahead leakage.
Why B is wrong: A uniform random shuffle is the default for non-temporal data, but for forecasting it places future-dated rows in the training set and past-dated rows in the test set, leaking future information and inflating the score.
Why C is wrong: Stratifying on the target balances sales magnitudes across splits, which is useful for imbalanced classification, but it ignores time ordering and still mixes future and past rows across the two sets.
Why D is wrong: Interleaving days by weekday seems to control for day-of-week seasonality, but it scatters test rows throughout the training period, again letting the model train on data that comes after the rows it is evaluated on.