Live model · 300 generated stores · computed in your browser

How much to bake tomorrow, in every store and every category

A bakery chain's stores differ by district — offices empty at weekends, residential streets fill up, campuses go quiet in the vacation — and every category has its own rhythm. Baking what sold on the same day last week is the usual rule. One model trained across all stores and categories forecasts the next two weeks with an interval, and turns the forecast into a production quantity that weighs a lost sale against a wasted loaf.

Demand forecasting and production recommendation

Generating a year of sales…

Before · bake last week's same-day sales + 10%
All 300 stores · 4 categories · 14 days
After · global forecast + production at the profit-maximizing quantile
All 300 stores · 4 categories · 14 days
demandlost sales (sold out)rule-of-thumb productionrecommended production80% forecast interval
1 · The right unit

Store × category × day, all year

The first request was a Christmas-cake forecast. The unit stores actually decide on is how much of each category to bake each day, all year, in every store — so the problem was re-scoped to mid-level categories covering most revenue, across 300+ stores.

2 · One model for all stores

Shared patterns, store-specific levels

District type, weekday, holidays, promotions, weather and season are learned once across all stores; each store-category brings its own recent level. In the project, Temporal Fusion Transformer, PatchTST and DeepAR were compared on sales, payment, discount and commercial-district data; here a regularized log-linear model plays that role.

3 · From forecast to quantity

Bake the quantile, not the mean

An unsold loaf costs its ingredients; a lost sale costs its margin. Producing at the quantile where those balance — the newsvendor rule — turns the forecast interval into a number of trays, and it is that number, not the forecast, that moves revenue.