You are evaluating a sales forecasting model. How should you split the data?
- Exam domain
- Advanced Data Structures7% of the exam
- Difficulty
- Medium
- In this mock
- 4 questions on this domainPractise this domain
Why the exam asks this
Advanced Data Structures (7% of the exam)
Objective in the exam guide: Time-series data handling, splitting, and forecasting evaluation
Time-series splitting and evaluation are named.
Why C is the answer
Train on earlier periods and test on later ones
Forecasts predict the future, so test on periods after the training data. Random shuffles leak future information.
Remember: Split time series by time.
How it works
Time-series evaluation uses time-ordered splits. GPU tools speed up large temporal analytics.
In detail
- Split by time.
- Use rolling or expanding windows.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Shuffle all rows randomly, then split 80/20 so both sets cover every season equallyWrongMost tempting
Shuffling leaks future data.
Why it tempts: Random splits are the default elsewhere.
B. Use the most recent data for training and older data for testingWrong
That reverses time.
C. Train on earlier periods and test on later onesRight
Split time series by time.
D. Test on the training dataWrong
Training data overstates accuracy.
Use case
An illustrative scenario, not a real incident.
Illustrative: a random split shows 4% error; a time split shows the real 11%.
See it in different ways
flowchart LR S0["Sort by date"] --> S1["Train on earlier window"] --> S2["Test on next window"] --> S3["Roll forward"] --> S4["Average errors"]
How to read this chart
- Read it in order: Sort by date, then Train on earlier window, then Test on next window, then Roll forward, then Average errors.
flowchart TD
Q{"Is order meaningful?"}
Q -->|"Yes, time series"| A0["Time-based split"]
Q -->|"No"| A1["Random or stratified split"]How to read this chart
- At "Is order meaningful?": if "Yes, time series", go to "Time-based split"; if "No", go to "Random or stratified split".
Learn more
- Our lesson: MLOps, time series, graphs and environments
- Practise Advanced Data Structures questions in the mock exam
- Source: Cross-validation (scikit-learn)
- Source: cuDF documentation (RAPIDS)
- MLflow documentation
- cuGraph documentation (RAPIDS)
- Managing environments (conda)
- nvidia-smi documentation (NVIDIA)
- Git documentation