Similar to ARIMA, for our LSTM model, we would like the model to use lagging historical data to predict actual data at a given point in time. However, in order to feed this data forward to an LSTM model, we must format the data so that a given number of columns contain all the lagging values and one column contains the target value. In the past, this was a slightly tedious process, but now we can use a data generator to make this task much simpler. In our case, we will use a time-series generator that produces a tensor that we can use for our LSTM model.
The arguments we will include when generating our data are the data objects we will use along with the target. In this case, we can use the same data object as values for both arguments. The reason this is possible has to do with the next argument, called length, which configures the time steps to...