Machine learning demand forecasting: methods, data, limits

Elie Dufeu, CTO and Co-Founder of Metreecs
Jean Jass
Head of communication
Share

By Elie Dufeu, CTO & Co-Founder, Metreecs. Published 29 October 2026.

Machine learning demand forecasting uses models that learn the relationship between sales and their drivers (price, promotions, seasonality, weather, store traits) across many products at once, instead of fitting one formula per product. It beats classic statistical methods when you have many related products, rich driver data, and a clean testing process, and it can lose to them when history is short, sparse, or noisy.

That second half matters more than most vendor pages admit. In the M5 forecasting competition, built on 42,840 Walmart sales series, the winning entries were all machine learning models, yet only 7.5% of the competing teams managed to beat a simple exponential smoothing benchmark. Machine learning can win by a wide margin, and many attempts at it still fail.

This guide is for planners and supply chain leads who want to know what these models actually do. It covers the main model families, what the large forecasting competitions show about when machine learning wins, the data you need, how to test a model before trusting it, and where the limits are. If you would rather see the methods run on your own sales history, you can book a short working session on your data.

Key Takeaways

  • In the M4 competition (100,000 series), none of the six pure machine learning methods beat a simple combination of statistical benchmarks, and 12 of the 17 most accurate methods were combinations of mostly statistical approaches (Makridakis et al., International Journal of Forecasting, 2018).
  • In the M5 competition (42,840 Walmart retail series), the top-ranked methods were machine learning models, mostly gradient-boosted trees trained across many series at once (Makridakis et al., International Journal of Forecasting, 2022).
  • Only 7.5% of M5 teams outperformed the best simple benchmark, an automatically selected exponential smoothing method, according to a commentary published in the International Journal of Forecasting.
  • Gartner predicted in September 2025 that 70% of large organizations will adopt AI-based supply chain forecasting by 2030.
  • McKinsey found that early adopters of AI-enabled supply chain management improved inventory levels by 35% and service levels by 65% compared with slower competitors.

What is machine learning demand forecasting?

Machine learning demand forecasting is a method that trains an algorithm on historical sales and the factors that influence them, so it can predict future demand for each product, location, and period. Unlike a statistical model fitted to one series, a machine learning model learns shared patterns across thousands of series and many input variables.

The practical difference sits in what the model looks at. An exponential smoothing or ARIMA model reads one product's past sales and projects level, trend, and seasonality forward. A machine learning model reads a table: one row per product, store, and week, with columns for past sales, price, discount depth, promotion flags, holidays, product attributes, and anything else you can supply. It learns how those columns combine to produce demand.

This is why the term overlaps with "AI forecasting" without being identical. Our guide to AI demand forecasting covers the overall approach and where people stay in the loop. This article stays on the methods: which models are used, when they help, and how to check them.

The main machine learning forecasting models

Most machine learning demand forecasting systems in production use a small number of model families. Each one makes different trade-offs between accuracy, data needs, speed, and how easy it is to explain a forecast to a buyer.

MethodProsConsIdeal use case
Statistical baselines (exponential smoothing, ARIMA)Fast, transparent, strong on short or smooth seriesOne product at a time, weak with promotions and external driversBenchmark for every model; stable products with little promotional activity
Gradient-boosted treesHigh accuracy on tabular data, handle many drivers, fast to trainNeed careful feature engineering, can extrapolate poorly beyond past price rangesLarge retail ranges with promotions, price changes, and store differences
Random forestsSimple to tune, stable, resist overfittingUsually less accurate than boosted trees, large modelsQuick first model or a component in an ensemble
Neural networks (recurrent, convolutional, transformer-based)Learn patterns directly from long sequences, good with very large datasetsData hungry, slower, harder to explain, sensitive to setupVery large catalogs with long, dense histories
Hybrids and ensemblesCombine the stability of statistical models with the flexibility of machine learningMore components to maintain and monitorMixed ranges where no single method wins everywhere

Gradient-boosted trees

Gradient boosting builds hundreds or thousands of small decision trees, each one correcting the errors of the trees before it. On retail sales data it has become the default choice for machine learning demand forecasting, and the M5 results explain why: most of the top-ranked entries were built on gradient-boosted trees (the open-source LightGBM library in most cases), trained on groups of series rather than one product at a time.

Their strength is the table format. A tree can learn that a 30% discount on a basic product in a high-traffic store during school holidays behaves differently from the same discount on a seasonal product in a small store, without anyone writing that rule. Their weakness is extrapolation: a tree has never seen a price lower than the lowest price in its history, so it treats a deeper cut as if it were the deepest past one.

Neural networks

Neural networks for forecasting range from recurrent networks that read sales week by week to newer transformer-based models pre-trained on large collections of time series. They can find long-range patterns without manual features, which is attractive for very large catalogs.

In retail planning they are usually not where a machine learning demand forecasting project should start. They need more data and more tuning, and a planner asking "why is next week's forecast 40% higher?" gets a much weaker answer from a deep network than from a tree model with feature importance scores.

Global versus local models

Modern machine learning demand forecasting rests on the global model. A local model is fitted to one product's history. A global model is trained on many products together, so a slow seller with two years of patchy sales can borrow patterns from hundreds of similar products.

Global training is what makes machine learning practical for long ranges. It also explains part of the M4 to M5 shift: the M5 data came from one retailer, with related products, shared calendars, and price and promotion data, which is exactly where a global model can learn from neighbors.

When machine learning beats statistical forecasting

The best public evidence on this question comes from the M competitions, large open forecasting contests run by academics since the 1980s. Two recent editions give very different answers, and the difference is instructive.

The M4 competition used 100,000 series from many unrelated domains (finance, demographics, industry, and others), with no external variables. The organizers' M4 findings paper reports that none of the six pure machine learning methods beat a simple combination of statistical benchmarks, and only one beat a seasonally adjusted naive forecast. The winner was a hybrid that combined exponential smoothing with a neural network.

The M5 competition used 42,840 hierarchical unit sales series from Walmart stores, with prices, promotional events, and calendar data included. Here, according to the M5 accuracy results paper, the top-ranked methods were all machine learning, mostly gradient-boosted trees trained across many series.

Putting the two side by side gives a usable rule. Machine learning demand forecasting tends to win when:

  • You forecast many related products sold through the same network, so a global model can share information.
  • Demand responds to drivers you can measure and provide in advance, such as price, discount depth, promotions, holidays, and store events.
  • You have enough history at the level you forecast, usually two or more full seasonal cycles for the bulk of the range.
  • You can test models properly against simple benchmarks before using them.

Statistical methods tend to hold their own when series are short, unrelated, smooth, or driven mostly by trend and seasonality with few measurable causes.

Statistic callout: only 7.5% of the teams in the M5 accuracy track outperformed the best simple benchmark, an automatically chosen exponential smoothing method with bottom-up aggregation, per a commentary on the competition published in the International Journal of Forecasting.

That number is the honest caveat behind the headline. The best machine learning entries won by a clear margin, but most attempts did not beat a method that runs in seconds. One mistake we repeatedly see is a team comparing its new model only to the old process, which may include manual overrides and stale parameters, instead of to a clean statistical baseline. Against a weak comparison almost anything looks like progress.

Consider Laura, who plans replenishment for a chain of 80 home and garden stores. Her team trained a boosted tree model on three years of sales, promotions, and local weather, and it cut forecast error noticeably on promoted products in spring. On the 400 slowest products, though, it did slightly worse than the simple seasonal method it replaced, so she kept both and let each product's backtest decide. (Laura is an illustrative example; the pattern is common.)

Data requirements for machine learning demand forecasting

Better models rarely fix poor data, and data preparation takes most of the work in any machine learning demand forecasting project. These are the inputs that matter most, roughly in order of impact.

Clean sales history at the right level. You need sales by product, location, and day or week, ideally two or more years to capture at least two seasonal cycles. Returns, transfers between stores, and wholesale orders should be separated from customer demand.

Stock and availability data. If a product was out of stock for three weeks, its sales were zero because there was nothing to sell, not because nobody wanted it. Without stock history, the model learns that demand drops whenever availability drops, and the next order is too small. Flagging or correcting these periods pays back more than almost any model change.

Price and promotion history. Regular price, actual selling price, discount depth, promotion type, and placement. This is the data that lets machine learning demand forecasting outperform statistical methods, because a seasonal formula cannot see a promotion coming.

Calendar and events. Public holidays, school holidays, paydays, local events, and store openings or closures. Many of these shift dates every year, which statistical seasonality handles poorly.

Product and store attributes. Category, price tier, color, size, launch date, store size, region, and format. Attributes let the model connect a new or slow product to similar ones.

External signals, where they help. Weather, local traffic, or macroeconomic data can add accuracy for some categories, garden furniture and outerwear in particular. They also add noise for others, so each one should earn its place in testing. Test them one at a time, with and without, on the same backtest.

In Metreecs' experience deploying product-level forecasting, the stockout flag and the promotion calendar are the two inputs teams most often lack in usable form at the start. Neither is glamorous, and both matter more than the choice of algorithm.

Feature engineering

Features are the columns the model reads. For sales forecasting the most useful ones are usually lagged sales (sales one, two, four, and 52 weeks ago), rolling averages and rolling volatility, price relative to the product's usual price, days until and since a holiday, and the share of the category on promotion. Gradient-boosted trees depend heavily on these features, and a well-built feature set often matters more than the choice between two algorithms.

How to test machine learning demand forecasting before you trust it

A model that looks accurate on the data it was trained on can still fail on next season. Backtesting checks a model the way it will be used: forecast a past period using only data available before it, then compare with what actually sold.

  1. Pick a fair benchmark. Use a seasonal naive forecast and an automatic exponential smoothing model as the minimum. Any machine learning model has to beat both to justify its extra complexity.
  2. Use rolling origins. Repeat the backtest from several cut-off dates (for example, the start of each of the last eight months), so one unusual period does not decide the result.
  3. Match the real forecast horizon and level. If buyers order eight weeks ahead by product and store, test at eight weeks ahead by product and store, not one week ahead by category.
  4. Measure accuracy and bias separately. A weighted error metric shows how far off the forecast is; bias shows whether it leans high or low. Our guide to forecast accuracy metrics explains which ones to use and why.
  5. Segment the results. Report fast movers, slow movers, promoted products, and new products separately. An overall gain can hide a loss on the segment that ties up the most stock.
  6. Translate error into stock. Run the forecasts through your safety stock and ordering logic and compare the resulting inventory and availability, because that is the outcome the business pays for.

Pro Tip: keep the statistical baseline running after go-live. When the machine learning forecast and the baseline diverge sharply on a product, that gap is a useful exception alert for the planner, often pointing to a data error or a promotion that was entered late.

Take Omar, a demand planner at a beauty brand selling through 120 doors. His first model looked excellent until his team segmented the backtest: most of the gain came from the 200 top products, while launches were forecast worse than before because the model had no attributes to link them to older ranges. Adding shade family, price tier, and launch channel as features closed most of that gap within two test cycles. (Omar is an illustrative example.)

Limits of machine learning in demand forecasting

Machine learning demand forecasting is a powerful set of tools, and it still has clear boundaries. Knowing them prevents disappointment and helps you decide where human judgment stays essential.

Intermittent demand. Products that sell zero most weeks and one or two units occasionally are hard for every method. Machine learning models can help when they pool many such products, but often they predict a small fractional amount every week, which is not a useful reorder signal on its own. Methods designed for intermittent demand forecasting and probabilistic forecasts usually serve these products better.

New products without history. A model cannot learn a product's pattern from data that does not exist. It can learn from similar products through attributes, which is a real advantage over statistical methods, but the quality depends entirely on how well those attributes describe what makes products alike. Forecasting products without sales history works best when attribute data and planner input are combined.

Structural breaks. A pandemic, a new competitor opening nearby, a change in pricing strategy, or a major range reset changes the rules the model learned. Models trained on the old regime keep forecasting it until enough new data arrives, so monitoring for drift and retraining regularly are part of the method itself.

Explainability. Buyers and planners need to understand a forecast before they commit money to it. Tree models with feature importance and per-forecast explanations are easier to discuss than deep networks, and this is one reason tree models dominate retail planning.

Cost and maintenance. Analyses of the M4 results noted that the most accurate hybrid methods needed far more computing time than simple benchmarks. In practice the bigger cost is people: data pipelines, monitoring, and retraining need ownership.

The supply chain directors we work with often underestimate how much of the gain comes from process changes around the model, such as weekly exception reviews and fixing stock data, rather than from the model itself. Across Metreecs' work with multi-store retailers, the projects that stall are usually the ones where the forecast is treated as a black box nobody reviews.

Daniel, who runs planning at a regional furniture retailer, learned this the hard way. His machine learning demand forecasting setup was accurate in testing, but buyers kept overriding its forecasts because nobody could explain the numbers. Once the planning screen showed the main drivers behind each forecast (a promotion, a holiday shift, a store refit), overrides dropped and the team spent its review time on genuine exceptions. (Daniel is an illustrative example.)

FAQ

Is machine learning better than statistical forecasting?

Not always. Machine learning demand forecasting tends to win when you have many related products, measurable drivers such as price and promotions, and enough history, as in the M5 retail competition. On short, unrelated, or smooth series, simple statistical methods are often as accurate and much cheaper, as the M4 competition showed. Test both on your own data.

Which machine learning model is best for demand forecasting?

For most retail and consumer goods data, gradient-boosted trees are the strongest starting point, because they handle many drivers and train quickly on large tables. Neural networks can help with very large catalogs and long histories. Ensembles that combine several models, including a statistical baseline, are often the most reliable in production.

How much data do you need for machine learning demand forecasting?

Aim for at least two full seasonal cycles of sales by product, location, and week, plus price, promotion, and stock availability history for the same period. Global models reduce the need for long history on each individual product, because slow or recent products borrow patterns from similar ones.

Can machine learning forecast new products?

Partly. A model can forecast a new product by learning from similar existing products through attributes such as category, price tier, color, and launch channel. The result is usually better than a pure guess but less reliable than a forecast for an established product, so planners should review launches more closely in the first weeks.

What is the difference between AI and machine learning in forecasting?

Machine learning is the part of AI that learns patterns from data, and in forecasting it is the part that produces the numbers. "AI forecasting" is a broader label that can also include automated data cleaning, exception detection, and recommendations built on top of the forecast.

Conclusion

Machine learning demand forecasting delivers its gains when many related products, good driver data, and honest backtesting come together, and it should always prove itself against a simple statistical baseline first. A sensible first step is to audit your stock-out history and promotion calendar, since those two inputs decide most of the result. To see how product-level machine learning forecasts perform on your own range, connected to AI demand planning workflows, request a demo with your sales history.

Sources

  • Makridakis, Spiliotis and Assimakopoulos, The M4 Competition: Results, findings, conclusion and way forward, International Journal of Forecasting, 2018: performance of pure machine learning methods against statistical benchmarks, share of combinations among the most accurate methods, hybrid winner.
  • Makridakis, Spiliotis and Assimakopoulos, M5 accuracy competition: Results, findings, and conclusions, International Journal of Forecasting, 2022: dataset size and the dominance of machine learning methods among top-ranked entries.
  • Kolassa, "Commentary on the M5 forecasting competition", International Journal of Forecasting, 2022: share of teams that beat the exponential smoothing benchmark.
  • Gartner, press release of 16 September 2025: prediction that 70% of large organizations will adopt AI-based supply chain forecasting by 2030.
  • McKinsey, 2021 article on succeeding with AI in supply chain management: inventory and service level gains for early adopters of AI-enabled supply chain management.

Our articles

Own your operations with AI Intelligence