Coder Social home page Coder Social logo

takumiw / time-series-demand-forecasting Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 16.0 2.65 MB

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

License: MIT License

Jupyter Notebook 100.00%
lstm airline-passengers gru prophet time-series-forecasting keras python3

time-series-demand-forecasting's Introduction

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

time-series-demand-forecasting's People

Contributors

takumiw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

time-series-demand-forecasting's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.