The problem
A café owner plans tomorrow's staff, milk and baking tonight, usually from memory: last Saturday was busy, so this one will be. A forecast does the same from the whole history, says how sure it is, and knows that Christmas Eve is no ordinary Thursday.
The same method plans rotas for restaurants and clinics, stock for shops and staffing for call centres: anywhere demand follows the week and the calendar.
The data
730 days of orders at Brew & Bun, a made-up café in Besant Nagar, Chennai, ending on 22 Nov 2026. The end date is fixed, so the forecast on the demo stays the same from one visit to the next.
I generated them from rules a café would recognise: growth of about 8% a year with good and bad spells, weekends busiest and Mondays quietest, a busy December, a quieter north-east monsoon in late October and November, heavy-rain days that empty the tables, and noise. The orders are made up; the festival dates are real: Thai Pongal, Kaanum Pongal, Deepavali, Christmas Eve, Christmas Day and New Year's Eve as observed in Tamil Nadu, from the state's holiday lists.
You can upload your own file of date,value rows: at least 56 days of daily values, with dates written 2026-03-14 or 14/03/2026. Small gaps are filled from the days either side and repeated dates are added together; the demo says when it does either.
The model
Holt-Winters keeps three running estimates and updates them every day: the level (an ordinary day's orders), the trend and the weekly pattern. A forecast day is level plus trend plus that weekday's pattern. The trend is damped, so it fades over the coming weeks instead of running away, and it may only change slowly (β = 0.02): left free, a few rainy days at the end of a short history read as a collapse. The other smoothing weights are chosen to give the smallest one-day-ahead error.
Two things Holt-Winters cannot see on its own. Festivals: I swap each past festival day for an ordinary one (the median of the same weekday one and two weeks either side), learn each festival's effect as actual ÷ ordinary, and multiply future festival days by it. Time of year: with a year or more of history, I learn how busy each part of the year runs against the year as a whole, divide it out before fitting and put it back afterwards. Without that, the model would carry November's monsoon lull straight into December.
Two baselines it has to beat: the same weekday last week, and a linear regression of log orders on the calendar (a trend, the weekday, the month and a flag for each festival). The 80% band is Holt-Winters' own error formula, so it widens with every day ahead.
The pipeline
- 01Clean
Each past festival day is swapped for an ordinary day of the same weekday.
- 02Season
The time-of-year pattern is learnt from the history and divided out.
- 03Fit
Holt-Winters (weekly pattern, damped trend) searches its smoothing weights for the smallest one-day-ahead error.
- 04Forecast
Up to 42 days ahead with an 80% band; time of year and festival effects go back on.
- 05Plan
Each day becomes barista shifts and litres of milk from the assumptions you set, and downloads as CSV.
- 06Backtest
Every model is refitted without the last 8 weeks and scored on them.
Results
Measured when this page was built, with the same code the demo runs, on the café's last 8 weeks (28 Sep 2026 to 22 Nov 2026), each model refitted on the days before them. Each festival day was predicted from the festival's other year only. On ten more samples drawn the same way, Holt-Winters and the regression came out level (9.5% against 9.5%; Holt-Winters ahead on 5 of 10), both well ahead of same-day-last-week (16.4%, beaten 10 times out of 10). The band held 69% of days on average: a little narrower than it should be.
For a client
With a café's real till data I would start the same way, then add what moves its orders: the weather forecast (rain is the biggest miss here), local events, promotions and price changes.
I would refit every night, watch the error week by week, and flag any day that lands outside its range so someone looks at why.
The planning step grows with the business: shifts by the hour rather than by the day, and orders for milk, bread and beans drafted from the forecast with each supplier's lead time.
Stack
Privacy
Everything happens in your browser. A file you upload is read in this tab and never leaves it: there is no server behind this page.
Limits
- The orders are generated, so the scores show how well the models recover the rules I wrote, not how they would do for a real café.
- Two years give only two examples of each festival, so one odd day moves an effect a lot. The furthest from the rule behind the data is Christmas Day: +30% learnt against +22% in the rule.
- Rain causes the biggest misses, and nothing in the history says when it will pour. A real version would read the weather forecast.
- The band assumes the coming weeks behave like the past two years. On other samples it held about 7 days in 10 rather than 8, so for milk and anything else that must not run out I would plan from the top of the range.
- With under a year of history there is no time-of-year pattern, so a forecast made in November cannot know that December is busier.