Cérélia · Production ML · Sep 2024 – now

Margherita: AI demand forecasting across 14 countries

Long-term forecast accuracy up from 73% to 82% at the 6-month horizon and ahead at 9 months, combined with SAP IBP and delivered to Operations every Monday.

73% → 82%
6-month forecast accuracy
815+
SKUs across 14 countries
~215k t
volume forecast each year
Weekly
in production since launch
Margherita's Power BI forecast comparison page: weekly demand against the AI and SAP forecasts, with accuracy gauges

At a glance

Problem
The challenge was one sentence: prove the potential of AI. Cérélia's demand plans came from SAP, and its long-term forecasts swung widely: unstable at the 6- and 9-month horizons used for capacity planning.
My role
Proposed the project, got it approved, and owned it end to end.
Goals
  • Make long-term forecasts reliable enough for capacity planning, with no more forecasts that collapse or explode further out.
  • Give non-technical teams easy access to the forecast through tailor-made Power BI reports.
  • Put it in production inside SAP through a custom development, so Operations is fully autonomous and decides how much to rely on AI.
  • Keep Cérélia independent from third-party tools: the deployment framework can take forecasts from any model.
People
Worked with the Operations team to shape the solution, and with an external team to design an SAP integration that combines the AI forecast with SAP's own.
Outcome
  • The Cérélia team now has full control of the forecast: they can process the files as they want and upload a forecast directly into SAP, which was not possible before.
  • A reliable long-term forecast makes it easier to plan large capex, such as a new production line.
  • Long-term forecast accuracy improved at the 6- and 9-month horizons: from 73% to 82% at 6 months.
  • 815+ SKUs in 14 countries, delivered every Monday.
  • The Sales team has easier, independent access to the forecast through Power BI reports, and can send forecast suggestions directly in Power BI using Power Apps.
  • The financial impact could not be measured, because there was no prior benchmark.
Hybrid choice
The solution let the team choose, per product and client, how to combine the AI forecast with SAP IBP's. For example, for product X sold to client A, they could keep the IBP forecast for the first 8 weeks and use the AI forecast for the remaining 64.
Role
Data Science Consultant End-to-end owner
Built with
Python, scikit-learn, XGBoost, pandas, Power BI, Microsoft Fabric, SAP IBP, SharePoint

The brief

Before I joined Cérélia, the challenge was one sentence: prove the potential of AI. I proposed a demand-forecasting project benchmarked against the existing SAP forecast, got it approved, and owned it from data extraction to production.

Cérélia is a multinational raw-dough producer with about €844M in 2024 revenue and more than 1,200 SKUs. Margherita now covers 815+ of them in 14 countries, about 97% of the Continental Europe Dough division, with weekly forecasts on a 72-week horizon.

Results

  • The team owns its forecast. The Cérélia team now has full control of the forecast: they can process the files as they want and upload a forecast directly into SAP, which was not possible before.
  • Easier long-term planning. A reliable long-term forecast makes it easier to plan large capex, such as a new production line. The financial impact could not be measured, because there was no prior benchmark.
  • Long-term accuracy up 9 points, from about 73% to 82% on a 6-month horizon; the gains were observed on long-term accuracy, at the 6- and 9-month horizons. Accuracy is measured per SKU and weighted by sales volume, so an overestimate on pizza dough can’t hide an underestimate on pie crusts. For example, with two products, demand 1,000 against a forecast of 900 (90%) and demand 10 against a forecast of 2 (20%) give 89.3% weighted accuracy, not a 55% simple average.
  • More stable: across 25 consecutive forecast start dates (week 51 of 2024 to week 23 of 2025), the AI forecast consistently outperformed the existing one at the 6-month horizon, with much lower variability. The same holds at 9 months.
  • The team chooses the mix. The solution let the team choose, per product and client, how to combine the AI forecast with SAP IBP’s. For example, for product X sold to client A, they could keep the IBP forecast for the first 8 weeks and use the AI forecast for the remaining 64.
  • No more “collapsing” or “exploding” forecasts, and moving peaks such as Easter and Ramadan land in the right weeks.

Weighted accuracy over time, 6-month horizon: the AI model stays around 80–85% while the published consensus forecast swings between 55% and 80% Volume-weighted accuracy, 6-month horizon, all customers. Blue: Margherita. Orange: published consensus forecast.

6-month accuracy for French customers 6-month accuracy for Italian customers The same comparison for French (left) and Italian (right) customers.

Weighted accuracy over time, 9-month horizon 9-month horizon, 16 consecutive forecast start dates.

The existing forecast favours short-term accuracy: it reacts fast to demand changes but drifts badly further out. It also places Easter and Ramadan peaks on last year’s week numbers.

Example of a collapsing SAP forecast while Margherita follows demand Example of an exploding SAP forecast while Margherita follows demand A collapsing (left) and an exploding (right) SAP forecast, against Margherita and actual demand.

How it works

Data preparation. Warehouse-level daily sales are aggregated to client and week, which removes noise from stock transfers and the zeros of twice-weekly ordering. Forecasts are split back to warehouses using the last eight weeks of sales mix.

When a client suddenly doubles its volumes, PELT change-point detection finds the break and shifts earlier sales to the new level. When clients don’t receive their full order, the next week’s demand is corrected so supply problems don’t create artificial peaks.

PELT change-point detection on a sales series The same series after shifting sales before the change point PELT detects a drop in a client’s sales (left); earlier sales are shifted to the new level (right).

Features. I tested vacation days, holidays, sporting events and even TV cooking shows. Easter, Ramadan (including its week number), promotions and national holidays carried the signal; the rest mostly overfit.

Promotions were the hardest part: their type was only recorded in emails. I encoded the week of each promotion, the number of promotion days per week, and the size of the warehouses involved, which let the model learn how strongly each promotion moves demand. It also lowers the forecast when last year’s promotion doesn’t repeat.

Margherita capturing a three-week promotion Margherita captures a three-week promotion and spreads the volume correctly across its weeks.

Model. Tree models can’t extrapolate a trend, and linear models can’t capture much variability. Margherita combines both: a linear regression fits the trend, an XGBoost model learns its residuals, and the two are added. It’s light enough to run on Sunday and deliver every SKU’s forecast by Monday morning.

Linear regression trend plus XGBoost forecast of the residuals The linear trend is extrapolated; XGBoost forecasts the residuals on top of it.

Delivery

Forecasts used to require SAP extractions and third-party Excel tools that only a few people in Operations could run. I built a multi-page Power BI report on Microsoft Fabric, refreshed weekly, with filters by recipe, type, temperature and segment, and six accuracy metrics for any horizon.

Power BI report with the filters menu open

To put the forecast to work, I designed new SAP key figures and led their implementation with up to seven internal and external stakeholders. Operations now choose, for each SKU and client, up to which horizon they use the AI forecast or the SAP one. The same framework can load forecasts from any other model, so Cérélia is no longer tied to one vendor’s methods.

How it was rolled out

  • Pilot: non-seasonal, existing products in the French market.
  • First expansion: after that validation, all products, plus Italy, Germany, Spain and Portugal.
  • Last phase: the remaining countries.

Progress was presented in several sessions to the executive committee (CODIR), which validated the move to production.

What made it hard

No one in the company had used Python, pip install returned “Access Denied”, and sales history could only be downloaded two weeks at a time. Data quality was uneven, and key data such as promotion types was not in any system.

The biggest challenge was cultural: replacing manual Excel adjustments in a perishable-goods business, with a model using up to 12 variables, while reassuring planners that they keep full control. I also arrived barely speaking French.

Enrico with a Cérélia colleague in front of the company logo, Paris office Enrico with another Cérélia colleague in front of the company logo With Cérélia colleagues.