How To: Machine Learning-Driven Demand Forecasting (2023)

In this non-technical article, I will explain what machine learning is, how it works, and what you can expect from using it when forecasting demand. We will also discuss pitfalls and best practices when launching an ML initiative.

How To: Machine Learning-Driven Demand Forecasting (1)

Usual statistical models apply a set of known relationships to a dataset. For example, exponential smoothing will have its way of estimating the underlying demand level and trend.

Simple exponential smoothingWhat is the simple exponential smoothing model?towardsdatascience.com

On the other hand, machine learning is about letting an algorithm understand a dataset and its underlying relationships on its own.

How To: Machine Learning-Driven Demand Forecasting (2)

How Does the Machine Learn?

A Machine Learning algorithm will run through a dataset, look at data features, and (try to) pick up any underlying relationship.

When working on a machine learning model, you need to pay attention to two main aspects:

  • The data (features) you give to your model.
  • The hyper-parameters of your machine learning model.

Choosing the correct data to feed to your model is tremendously important. Data scientists shouldn’t be left alone regarding what data to use; everyone should help. When you create your forecasting algorithm, you should ask yourself the following question:

If I had to make a demand forecast for how much products we are going to sell next month, what questions would I ask myself?

As you ask yourself — and your team — this question, you will get a glimpse of the most meaningful information to give to your model.

(Video) Machine Learning for Demand Forecasting in Supply Chains

Here are a few typical answers:

  • What is the current pricing of my product, and did it change over the last months?
  • What is the monthly sales average of my product?
  • Was the product recently out of stock?
  • Are we currently running some promotions?

By providing relevant data to your ML model, it will be able to predict future demand more accurately.

Machine Learning for Supply Chain ForecastWhat is machine learning?towardsdatascience.com

Many companies expect too much or too little from using a machine learning model to forecast their sales. If you expect and promise too much, top management will get frustrated, and demand planners will become cautious and reluctant to use an overpromised tool. On the other hand, if you expect too little from ML, you will never launch a data science initiative that will prove to have a very high ROI.

How much extra forecasting accuracy can you expect from using machine learning?

Recent forecasting competitions (such as M5 and Corporación Favorita) showed an error reduction of 20 to 60% compared to forecasting benchmarks. The intermarché competition saw a minor reduction, but this is due to the logarithm scale used (see my webinar below about it).

Since 2018, all demand forecasting competitions have been won by machine learning. What are you waiting for?

For more information, see Learnings from Kaggle’s Forecasting Competitions By Casper Solheim Bojer & Jens Peder Meldgaard.

Based on my own consultancy experience, usual machine learning projects result in a forecast error reduction ranging from 5% to 20% compared to a moving average.

Usually, this accuracy improvement will be higher as you bring more data. For example, by providing more demand drivers (historical stock levels, promotions, marketing, pricing) or by forecasting at a daily or weekly level.

Machine Learning and Demand Planners

Note that by improving your forecasting baseline accuracy, you will also improve the overall forecasting process accuracy, as your demand planning team will be able to edit the forecast when needed (they should nearly always be able to add some extra accuracy). For example, let’s imagine your current forecast engine reaches an accuracy of 50% and that your team usually can raise it to 55% thanks to their work. By updating the model and using machine learning, you can reach a baseline accuracy of 55%. Then your team might be able to raise it further to 57 or 58%.

Demand planners can always improve a model’s forecast by using information that the model is unaware of (for example, by communicating with your clients).

Machine Learning models won’t make your demand planning team obsolete — but they might reduce their workload.

(Video) MACHINE LEARNING IN DEMAND FORECASTING - REINVENTING RETAIL

Launching a machine learning initiative requires paying attention to a few critical aspects. If you miss them, you’re likely to fail to deliver results.

Data Quality

Don’t use sales data! You should forecast demand, not sales.

Bad data will beat a good forecaster. Every time.

Capturing Unconstrained Demand in Supply ChainsThe article below is a summary of one of my LinkedIn posts. If you are interested in such debates, let’s connect! I…towardsdatascience.com

Expectations

As discussed above, promise too much, you will disappoint (and face end-users resistance). But, on the other hand, promise too little, and the project won’t get traction.

Bad Process

The objective of demand forecasts is not to be accurate. But to be helpful for your supply chain to take the right decisions.

In short, if you are not forecasting the right thing, there is no point in improving your forecast accuracy. So first, you should make sure that you are forecasting your demand at the right level of aggregation. Then work on improving our model.

For example, many companies forecast demand by month by market. Whereas they need to deploy inventory on a weekly basis from their plants to a few warehouses in the world. It would make more sense to focus on weekly demand forecasting by warehouse than monthly forecasting by market.

First, fix the process. Then, improve the model.

The 4-Dimensions Forecasting FrameworkHow to Set Up a Forecasting Processtowardsdatascience.com

Wrong Metrics

I still see many supply chains using MAPE as a forecasting metric. There is simply no point in running any forecasting improvement until you are sure you are tracking the right metric.

Many supply chains also sell different products over a wide price range. A forecast error on a product worth 1 cent is less important than a similar forecast error on a product worth hundreds of euros/dollars.

I advocate for supply chains to track wMAE (price-weighted MAE) and wBias (price-weighted Bias). Combining these two metrics will allow you to pay attention to the products that matter the most and be sure not to have a biased model.

(Video) Forecast Your Products’ Demand with Machine Learning

Project Management

Gather a team of motivated, open-minded, curious, dedicated members (you’ll need different profiles). Based on my experience, the beginning of the machine learning journey is the most difficult: you need to gather and clean data without promoting any short-term successes. That’s why you’ll need a motivated team that will spend the time necessary to collect relevant data.

You will also have to assess what demand drivers you should use for your model.

📊 External Data. Pay attention that external data might be both expensive and inconsistent. For example, many external providers will share market information a few months later and based on a granularity that won’t match your requirements. Just avoid it.

🌦️ Weather. Weather impacts many supply chains: you will sell more or less depending on the weather. Unfortunately, you can’t predict the weather accurately more than a few days in advance. I usually take the example of ice creams: sales are highly impacted by sunlight, but you can’t predict the weather four weeks in advance to plan your production.

Data Science

When doing a demand forecasting project, I like to follow the steps highlighted below.

How To: Machine Learning-Driven Demand Forecasting (4)

As you can see, it is crucial to start with a clear objective (in terms of granularity, horizon, and metrics) before beginning to work on data collection and model creation.

You should validate results against a test set that wasn’t used to train the model. For example, keep a few months of demand aside from the dataset you’ll use to train your model. You can then test it over these unseen periods to assess its accuracy.

How To: Machine Learning-Driven Demand Forecasting (5)

1️⃣ Data Gathering & Cleaning

👩‍💻 Power Users

In this first phase, you will gather and clean historical demand and demand drivers. Pay attention that getting some demand drivers’ data might take months (and call for time-intensive work). Instead, you might want to go straight to step 2 and try another model later with more data.

✔️Skip this step if you already use relevant data in your current forecasting software

(Video) Introduction to Forecasting in Machine Learning and Deep Learning

2️⃣ Model Creation

👩‍🔬 Data Scientists

Data scientists will try out different models with different data features until they achieve the desired results.

3️⃣ Model in Production

👩‍💻 Data Engineers

Once you have a working model, you can transfer it from a “manual/local computer” setup to an “automated/cloud” one.

Pay attention that the time invested in moving a working model from a local machine to the cloud (and automate it) might not be worth it. I’ve seen projects losing three months to transfer a working model to the cloud, hoping to save 10-30 minutes of manual work per week.

✔️ Skip this step if you’re ok with running the model manually once a week/month

4️⃣ User Acceptance

👨‍💼 Project Manager

The model accuracy should be tested against future unseen data. This is the only way to assess forecasting quality. Remember to compare the accuracy achieved by your model with the one achieved by a simple benchmark (see article below), your current forecasting engine, as well as your consensus forecast.

Do not hesitate to do a few parallel runs to confirm that the new model works fine.

(Video) Demand forecasting: how predictive analytics helps plan for the future

How much extra accuracy can we expect from using machine learning to forecast demand?

Usually, machine learning models beat state-of-the-art forecasting software by 5 to 15%. Better accuracy can be achieved as more data is available (demand drivers).

How to Launch a Proof of Concept (POC)

  1. Gather initial data (you can use your current statistical tool data)
  2. Optimize a model
  3. Do a few trial runs
  4. Success? Implement your solution!

FAQs

How does machine learning help forecasting? ›

Machine learning (ML) in demand forecasting makes it possible to avoid traditional challenges associated with planning such as long delivery lead times, high transport costs, high inventory and waste levels, and incorrect decision making due to inaccurate forecasts.

Which ML models are used for demand forecasting? ›

Deep Learning Modelling

ANN and LSTM models can be used for forecasting. LSTM gives better results as compared to ANN. In LSTM, the training set should have 24 inputs to predict next month's output.

How can data science ML help in improving demand planning activity? ›

Adding ML to your demand generation toolset not only helps marketers better understand demand but it may also make your business more profitable over time. ML technology uses data and patterns to predict future demand with uncanny accuracy, so companies can significantly improve their demand forecast with minimal risk.

Which machine learning algorithm is best for forecasting? ›

The ML algorithms for time-series forecasting dominating the literature are Multi-Layer Perceptron (MLP), Bayesian Neural Network (BNN), Radial Basis Functions (RBF), Generalised Regression Neural Network (GRNN), K-Nearest Neighbour regression (KNN), CART regression trees (CART), Support Vector Regression (SVR), ...

What are the 7 steps of machine learning? ›

The 7 Steps of Machine Learning
  • Data Collection. → The quantity & quality of your data dictate how accurate our model is. ...
  • Data Preparation. → Wrangle data and prepare it for training. ...
  • Choose a Model. ...
  • Train the Model. ...
  • Evaluate the Model. ...
  • Parameter Tuning. ...
  • Make Predictions.
Oct 19, 2022

How to use AI in demand forecasting? ›

AI demand forecasting can use the company's historical datasets to create a more accurate picture of its current growth and predict what the next year will look like. For example, AI can dig into the company's sales and see that it's averaging about 15,000 product sales a month, but that it's increasing 10% each month.

How does machine learning improve prediction accuracy? ›

  1. Method 1: Add more data samples. Data tells a story only if you have enough of it. ...
  2. Method 2: Look at the problem differently. ...
  3. Method 3: Add some context to your data. ...
  4. Method 4: Finetune your hyperparameter. ...
  5. Method 5: Train your model using cross-validation. ...
  6. Method 6: Experiment with a different algorithm. ...
  7. Takeaways.
Feb 17, 2021

What is ML based forecasting? ›

ML-based forecasts are able to incorporate a wide range of both historical and external data that helps deliver a finely tuned prediction, whereas traditional forecasting typically leverage just a slice of internal historical data, which can yield inaccurate predictions.

Which method is best for demand forecasting? ›

Here are five of the top demand forecasting methods.
  1. Trend projection. Trend projection uses your past sales data to project your future sales. ...
  2. Market research. Market research demand forecasting is based on data from customer surveys. ...
  3. Sales force composite. ...
  4. Delphi method. ...
  5. Econometric.
Aug 11, 2022

What is the three methods of demand forecasting? ›

Demand forecasting allows manufacturing companies to gain insight into what their consumer needs through a variety of forecasting methods. These methods include: predictive analysis, conjoint analysis, client intent surveys, and the Delphi Method of forecasting.

How do we improve machine learning models to provide better predictions? ›

Learn how to improve your ML.NET model.
  1. Reframe the problem. Sometimes, improving a model may have nothing to do with the data or techniques used to train the model. ...
  2. Provide more data samples. ...
  3. Add context to the data. ...
  4. Use meaningful data and features. ...
  5. Cross-validation. ...
  6. Hyperparameter tuning. ...
  7. Choose a different algorithm.
Mar 18, 2022

Which algorithm is used for forecasting? ›

Autoregressive Integrated Moving Average (ARIMA) is a commonly used statistical algorithm for time-series forecasting. The algorithm is especially useful for simple datasets with under 100 time series.

What data is needed for demand forecasting? ›

These forecasts use firm-level data and data about a firm's customers to predict demand for particular products and services. Data will often include historical sales, past and current financial metrics and sales team projections.

What are the 5 machine learning techniques for forecasting sales? ›

5 Machine Learning Techniques for Forecasting Sales

Linear Regression. Random Forest Regression. XGBoost. Long Short Term Memory (artifical recurrent neural network)

Is Python or R better for forecasting? ›

R can still outperform Python when analysing time series data. If you have worked with time series analysis before, you are most likely familiar with what is called the ARIMA (Autoregressive Integrated Moving Average) model. This is a model that can be used to make forecasts based on the structure of a time series.

What are the four 4 types of machine learning algorithms? ›

The four different types of machine learning are:
  • Supervised Learning.
  • Unsupervised Learning.
  • Semi-Supervised Learning.
  • Reinforced Learning.
Aug 5, 2022

What are 2 main types of machine learning algorithm? ›

There are four types of machine learning algorithms: supervised, semi-supervised, unsupervised and reinforcement.

What are the 3 types of machine learning algorithms? ›

The three machine learning types are supervised, unsupervised, and reinforcement learning.

What is DDM in machine learning? ›

DDM (Drift Detection Method) [3] is a concept change detection method based on the PAC learning model premise, that the learner's error rate will decrease as the number of analysed samples increase, as long as the data distribution is stationary.

How do you create a demand forecast model? ›

10 steps for forecasting demand and revenues for new products
  1. Step 1: Make it a collaborative effort. ...
  2. Step 2: Identify and agree upon the assumptions. ...
  3. Step 3: Build granular models. ...
  4. Step 4: Use flexible time periods. ...
  5. Step 5: Generate a range of forecasts. ...
  6. Step 6: Deliver the outputs that users need quickly.

How can AI make sales forecasting more accurate? ›

AI & chatbots can even help with lead scoring. The user information collected by chatbots can help in scoring the leads in a better fashion. Artificial Intelligence can help understand which leads are more likely to convert. This can help improve forecasts and help sales reps concentrate on the right prospects.

How to detect drift machine learning? ›

The most accurate way to detect model drift is by comparing the predicted values from a given machine learning model to the actual values. The accuracy of a model worsens as the predicted values deviate farther and farther from the actual values.

What are the example of data driven models? ›

A linear regression model is an example of a data driven model that, for example, builds a relationship between a dependent variable and a set of independent variables. This regeression model can then be used to understand the relationship between the variables, and in some cases can also be used to make predictions.

What are the examples of data driven modeling? ›

Data-Driven Model
  • Graphical Model.
  • Energy Harvesting.
  • Exponential Family.
  • Logistic Probability Model.
  • Sensor Node.

What are the 4 methods of demand forecasting? ›

Demand forecasting allows manufacturing companies to gain insight into what their consumer needs through a variety of forecasting methods. These methods include: predictive analysis, conjoint analysis, client intent surveys, and the Delphi Method of forecasting.

What are the 3 major approaches for forecasting? ›

Forecasting methods usually fall into three categories: statistical models, machine learning models and expert forecasts, with the first two being automated and the latter being manual.

What are the 2 methods of demand forecasting? ›

There are two main methods of demand forecasting: 1) Based on Economy and 2) Based on the period.

Videos

1. Strategic Foresight: Advancing Occupational Safety and Health
(Centers for Disease Control and Prevention (CDC))
2. Webinar - Machine Learning To Automate Demand Forecasting With Dynamic Pricing.
(Pluto7)
3. Best Practices for Demand Forecasting in 2023: How to Prepare for the Future
(Streamline Forecasting and Planning)
4. Azure Machine Learning Demand Forecasting P2
(Microsoft Tutorials & Training)
5. Time Series Forecasting Using Machine Learning| Python
(Nachiketa Hebbar)
6. Profio- Data-Driven Demand Forecasting Engine
(Peter Diwali)
Top Articles
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated: 02/07/2023

Views: 5745

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.