de
All references

[ forecasting × food craft ]

Know today what goes over the counter tomorrow.

In a butcher's shop rich in tradition, demand was estimated by experience for decades, the way you estimate tomorrow's weather. Today a forecasting system unifies the sales data from stores, webshop, and vending machines into one source of truth and predicts every night, for every article, what the next seven days will need, including a reliable range. This page shows how the system came to be, which decisions stand behind it, and what was learned along the way.

One source of truth

Registers, webshop, and vending machines merge into one shared sales history, safe against duplicates.

Models in competition

From simple baselines to a neural network: whatever forecasts measurably better wins.

Forecast with a range

Per article and day: the expected sale and the quantity to have ready, instead of one bare number.

Retrained every night

After closing time the model retrains completely, in eleven seconds, and picks up every change immediately.

[ the challenge in the craft ]

Gut feeling is experience. But it is not planning.

The butcher's trade is a craft rich in tradition and under pressure: skilled workers are scarce, the owner helps out in production, and little time is left for the back office. In many shops, digitalization ends at the register. So demand for the coming days is estimated the way you estimate tomorrow's weather: by experience and feel. On good days that is surprisingly accurate. On all the others, it gets expensive.

Produce too much and you get waste: goods are thrown away, or process costs pile up for reworking them, say when ground meat ends up in a lasagna that was never part of the assortment. Produce too little and you have to rerun production ad hoc, with setup costs nobody planned for. Or the customer faces an empty counter: the lost sale, quietly the most expensive mistake of all.

With the forecast, the business knows with reliable probability which article is needed in which quantity, focused on the highest-revenue articles. Attention returns to value creation instead of guesswork: dependable planning, less waste, happy customers.

[ every night, automatically ]

While the business sleeps, tomorrow's plan takes shape

The forecast is not a tool someone has to operate but a routine that runs by itself every night. After closing time the data passes through these stations, and in the morning the plan for the next seven days is ready.

[ Collect ]

Every channel delivers

After closing time the day's sales flow into the system: every receipt from the stores, every order from the webshop, every purchase from the vending machines. Each booking gets a unique key. Duplicates are ruled out, even if a day is loaded twice.

[ Unify ]

One source of truth

The channels are merged into one sales history per article. What matters is the total quantity: production is central, sales happen everywhere. Only this single view turns three systems into a solid basis for planning.

[ Enrich ]

The calendar joins in

Every day gets its context: weekday, public holidays and bridge days per state, school vacations, movable feasts like Easter. And the system detects on its own which days the business is closed, without anyone maintaining it.

[ Train ]

The model learns anew

The forecasting model retrains completely every night, in around eleven seconds. If demand shifts, say because a competitor closes, that flows in from day one, instead of consulting a stale model for months.

[ Forecast ]

Seven days ahead

For every article the forecast for the next seven days takes shape, not as one bare number but as a range: the expected sale and the quantity to have ready so the counter almost never runs empty.

[ Plan ]

From value to decision

By morning the forecasts have become a production plan: articles are bundled into production groups, say all varieties of ground meat into one shared quantity. And the system watches itself: if reality drifts away from the forecast, it speaks up.

[ architecture ]

Three layers, one goal: reliability

The same principle applies here: keep the layers strictly separate. The data foundation turns three channels into one truth, the model factory makes methods compete instead of trusting one, and the planning layer translates probabilities into production decisions.

Data foundation

Three sales channels, one sales history

Registers, webshop, and vending machines speak three different languages. Dedicated adapters translate them into one shared format: one row per article sold, with a unique key per booking. Reloading is safe at any time, nothing is counted twice.

The merge happens on the article number, which is valid across all stores. That sounds obvious but was one of the most important decisions: only then does each article get a continuous history across all points of sale, back to 2022, around 100,000 observations.

Every day is stored with its context: public holidays per state, school vacations, opening days. Training and forecasting work on the same complete data.

Model factory

Parameter study and competition instead of model faith

Before a model is allowed to count, it has to beat simple baselines: the same weekday last week, seasonal averages. Then several methods competed against each other, from classical statistical models through gradient boosting to a neural network, all in the same rolling backtest across many months.

A large parameter study examined the explanatory factors systematically, in groups and with statistical rigor. The result is surprising: the strongest factor is the sales history itself. Effects like grill meat demand dropping again after several warm days are already contained in the most recent sales. Explicit weather data was integrated and tested but added no measurable contribution on top. What does help a lot: movable holidays like Easter, school vacations, and the self-learned closing days.

The winner is a gradient-boosting method that estimates not one number but three: the lower edge, the expected value, and the upper edge. A downstream calibration makes sure this range keeps its promise.

Planning layer

From probability to production decision

Too little and too much are not equally expensive. That is why the system delivers two values: the expected sale for revenue and raw-material planning, and the provisioning recommendation that leaves the counter empty on only about one day in ten. The safety buffer becomes visible and adjustable, per article and day.

The system forecasts what is forecastable: the highest-revenue articles, which carry around 80 percent of revenue. Articles selling one or two units a day cannot be meaningfully predicted at daily level, mathematically, so they are planned by week. That boundary is not thrift but honesty toward one's own numbers.

For production, articles are bundled into groups, say all varieties of ground meat into one shared production quantity with yield factors. And the system watches itself: if reality deviates systematically from the forecast, monitoring raises its hand.

[ accuracy ]

How good is the forecast, really?

Accuracy is a question of planning level. On the hardest question, how much of exactly this article on exactly this day, the system is right in a good 6 out of 10 cases. Per article and week it is 3 out of 4, for the daily total across all articles more than 8 out of 10. And the range that provisioning relies on holds on almost 9 out of 10 days. Measured on around 36,000 real article-days across 18 months, always on data the model had never seen.

For perspective: simple rules of thumb reach around 30 percent at article level. And even a perfect oracle would only reach about 77 percent at these volumes, because daily demand at a few sales per article is to a large degree genuine chance. On that scale the model has covered about two thirds of the achievable distance, making it around 45 percent more accurate than seasonal baselines.

Just as important as the hits: knowing when to be careful. When the gap between expected sale and provisioning recommendation grows unusually wide, say around holidays, that is an honest signal for the master's double-check.

[ numbers ]

The system in numbers

3 → 1

sales channels, registers, webshop, and vending machines, unified into one source of truth

around 45%

more accurate than seasonal baselines, measured in a rolling backtest across 18 months

9 out of 10

days the actual sales fall inside the provisioned forecast band

11 seconds

for the complete nightly retraining: every change flows in from day one

[ technology ]

Technology in use

LightGBM
MLForecast
CatBoost
NeuralForecast
scikit-learn
pandas
LightGBM
MLForecast
CatBoost
NeuralForecast
scikit-learn
pandas
Python
Django
PostgreSQL
Docker
GitLab
Plotly
Python
Django
PostgreSQL
Docker
GitLab
Plotly

Put the potential of this technology to work.

Wondering where your processes still plan by gut feeling and what reliable forecasts would change there? Then let's talk: you bring the challenge, I bring the experience and the tools.