Skip to content

Time-series demand forecasting is constructed by using LSTM, GRU, LSTM with seq2seq architecture, and prophet models.

License

Notifications You must be signed in to change notification settings

takumiw/Time-Series-Demand-Forecasting

Repository files navigation

Time Series Demand Forecasting

In this repository, I implement time-series demand forecasting by using LSTM, GRU, LSTM with seq2seq architecture, and prophet models. I use Keras framework to construct deep learning models and the Prophet library to implement prophet.
The dataset is the monthly passengers of an International Airline link. The tutorial of the dataset is here.


Two-layer LSTM regression model

This is the result of using two-layer lstm model. All the implemented code is shown in stacked_lstm_regression.ipynb.
The training dataset is created by using 12 months as an input to the model and the following next one month as output of the model. The result below shows that the model predicts future monthly passengers quite well.

  • RMSE in the test period: 22.66
  • MAE is the test period: 18.28

Two-layer GRU regression model

This is the result of using two-layer GRU model instead of using LSTM layers. All the implemented code is shown in stacked_gru_regression.ipynb
The training dataset is created by using 12 months as an input to the model and the following next one month as output of the model.
The result below shows that the model predicts future monthly passengers slightly better than the LSTM model.

  • RMSE in the test period: 22.47
  • MAE is the test period: 18.16

Seq2seq two-layer LSTM model

This is the result of using LSTM model with seq2seq2 (Encoder+Decoder) architecture. This model is motivated by a paper Deep and Confident Prediction for Time Series at Uber blog paper. All the implemented code is shown in seq2seq_lstm.ipynb
The training dataset is created by using from t to t + 12 months as an input to the encoder, from t + 6 to t + 12 months as an input to the decoder, and from t + 13 to t + 18 months as an output of the decoder.
The result is evaluated on the RMSE and MAE of both the following next month and in the 6 months.

1. Result of predicting the following next month passengers.

Note that the test period is diffrent from other models.

  • RMSE in the test period: 19.38
  • MAE is the test period: 15.97

2. Result of predicting in the 6 months passengers.

Note that the test period is diffrent from other models.

  • RMSE in the test period: 21.51
  • MAE is the test period: 18.21

Prophet library

Finnaly I implement the OSS library, prophet. Prophet, which is developed by Facebook, is a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects.
The result is much worse than using LSTM or GRU models. The figure below indicates that prophet could not predict the incresing trend of the amplitude.

  • RMSE in the test period: 40.36
  • MAE is the test period: 31.17

Author

  • Takumi Watanabe (takumiw)
  • Sophia University

About

Time-series demand forecasting is constructed by using LSTM, GRU, LSTM with seq2seq architecture, and prophet models.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published