Performing the train-test split on a time series dataset
In the previous recipe, we generated a synthetic time-series dataset that we will use to train a DeepAR model in the next two recipes. Before we proceed with the actual training of the model, Before we proceed with the actual training of the model, we need to properly split the data first into the train and test sets. That is what we will do in this recipe!
When performing the train-test split with a time series dataset, it is important to note that we do not perform random splitting of the data as this would not preserve the temporal order of the observations.
Getting ready
Here are the prerequisites of this recipe:
- This recipe continues from Generating a synthetic time series dataset.
- A SageMaker Studio notebook running the Python 3 (Data Science) kernel.
How to do it…
- Create a new notebook using the
Python 3 (Data Science)
kernel inside themy-experiments/chapter08
directory and...