A finance company must forecast a commodity price using daily historical data. The data scientist should train models on 80% of the dataset and validate on the remaining 20%. How should the data be split so that model comparisons are valid for time-series forecasting?
Choose an answer
Tap an option to check your answer.
Correct answer: Choose a cutoff date so that 80% of the data points occur before that date; use those earlier points for training and the remaining later points for validation..
Why this is the answer
For time-series forecasting, it's crucial to maintain the temporal order of the data when splitting into training and validation sets. The correct approach is to use an earlier portion of the data for training and a later, unseen portion for validation. This simulates real-world forecasting where you predict future values based on past observations. The incorrect options violate this principle: Using later points for training and earlier points for validation reverses the natural flow of time, making the validation set effectively "before" the training data, which is not how forecasting works. Stratified selection or random sampling, while useful for other types of data, destroys the temporal dependencies inherent in time-series data. Randomly splitting the data means the training set could contain future information relative to the validation set, leading to an overly optimistic and invalid model evaluation.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed