Solved – How to make LSTM predict multiple time steps ahead

lstmrecurrent neural networktime series

I am trying to use a LSTM for time series prediction. The data streams in once per minute, but I would like to predict an hour ahead. There are two ways I can think of for going about this:

  1. Squash the data into hourly data instead, taking the average over each 60 minute time period as one data point.
  2. For each (X, y) training data pair, let X be the time series from t - 120 to t - 60, and let y be the time series from t - 60 to t. Force the LSTM to predict 60 timesteps ahead, and take y[-1] as the prediction.

Are there any best practices for going about this?

Best Answer

There are different approaches

  • Recursive strategy

    • one many-to-one model

      prediction(t+1) = model(obs(t-1), obs(t-2), ..., obs(t-n))
      prediction(t+2) = model(prediction(t+1), obs(t-1), ..., obs(t-n)) 
      
  • Direct strategy

    • multiple many-to-one models

      prediction(t+1) = model1(obs(t-1), obs(t-2), ..., obs(t-n))
      prediction(t+2) = model2(obs(t-2), obs(t-3), ..., obs(t-n))`
      
  • Multiple output strategy

    • one many-to-many model

      prediction(t+1), prediction(t+2) = model(obs(t-1), obs(t-2), ..., obs(t-n))`
      
  • Hybrid Strategies

    • combine two or more above strategies

Reference : Multi-Step Time Series Forecasting

Related Question