Demand forecasting using deep learning – IBM Developer


This pattern demonstrates how to use deep learning to forecast the demand for cash vending machines. It’s important for financial institutions to ensure that the cash vending machines don’t run out of money, which can increase the revenue and enhance customer experience.


Forecasting for cash vending machines can be demanding with various reasons for dips and spikes in the demand, such as weekday, weekend, location, beginning and ending of the month, and holidays. The biggest challenge is to remember the pattern of withdrawals with respect to the reasons stated previously. This is where deep learning comes into the picture, and we are referring to recurrent neural networks (RNN). The long-short term memory (LSTM) is a type of recurrent neural network. An RNN is a special type of neural network that is designed for sequence problems. We will be creating a sequence prediction LSTM model that can predict the next value when given an input sequence.

But why use deep learning for this? We need to mimic human behavior of cash withdrawals by remembering the recent past and then use what is learned to predict the future. We create the neural network model with recurrent layers, which process the information through the looping architecture of the network and generate the corresponding output. This produces accurate forecasts of cash demand, which in turn optimizes cash replenishments of the cash vending machines.

After completing this pattern, you understand how to:

  • Create a deep learning model using LSTM
  • Tune the hyper-parameters of the model
  • Use transfer learning using LSTM
  • Generate new forecasts on new data using the same model and weights
  • Use a cross validation technique for evaluating accuracy
  • Use a grid search technique for fit and score using different parameters


Forecast demand flow diagram

  1. User uploads the first input .csv file onto Object Storage.
  2. User runs the Notebook that will create a deep learning model and churn out forecasts.
  3. User uploads the second input file onto Object Storage.
  4. User runs the Notebook again using transfer learning of the deep learning model, and generates the forecasts.
  5. User learns how to create a deep learning model to be used on different data sets and achieve good accuracy.


Find the detailed steps for this pattern in the readme file. The steps show you how to:

  1. Create a deep learning model using LSTM.
  2. Understand and tune the hyper-parameters of the model.
  3. Transfer learning using LSTM.
  4. Generate new forecasts on new data using the same model and weights.
  5. Use cross validation techniques for evaluating accuracy.
  6. Use a grid search technique for fit and score using different parameters.

Sharath Kumar RK

Manjula Hosurmath

Reference: Source link

Sr. SDET M Mehedi Zaman

Currently working as Sr. SDET at Robi Axiata Limited, a subsidiary of Axiata Group. As a Senior SDET: - Played a key role in introducing Agile Scrum methodology and implementing CI/CD pipeline to ensure quality & timely delivery. - Trained colleagues on emerging technologies, e.g. Apache Spark, Big Data, Hadoop, Internet of Things, Cloud Computing, AR, Video Streaming Services Technology, Blockchain, Data Science- Developed a test automation framework for Android and iOS apps - Developed an e2e web automation framework with Pytest - Performed penetration testing of enterprise solutions to ensure security and high availability using Kali, Burp Suite etc. - Learned Gauntlet security testing automation framework and shared the lesson learned in a knowledge sharing session

Leave a Reply

Your email address will not be published. Required fields are marked *