A classic example: Christmas products. They don’t sell at all for ten months, and then sales suddenly spike in November and December. The key challenge here was teaching the model to distinguish true seasonal demand from random fluctuations or outliers. In the training window (33 months), such items only showed two peaks — which wasn’t enough for the model to recognize a meaningful pattern. As a result, it treated them as noise and continued predicting zeros.
What went wrong:
Each visualization includes a chart showing::
Solution: Feature Engineering to the Rescue
I extended the dataset with new signals to help the model understand seasonality:
For part of the catalog, the model consistently predicted zero. Items with very low turnover and long zero-sales stretches quickly “taught” the model a safe rule → Always predict zero.
What went wrong:
Solution
This turned out to be one of the most difficult challenges. For some items – especially when low volumes were combined with promotional campaigns — zero predictions still dominated.
The breakthrough came only after changing the normalization strategy (individual approach for each feature) and adding new contextual features:
A typical example is small electronics: most of the year, sales trickle in slowly — just a few units per month. But once the e-shop launches a -20% weekly promo, orders can spike by dozens of units, only to drop back down once the campaign ends. Promotions were fairly common in the dataset — some items had several campaigns per year.
What went wrong:
Solution
Once again, I turned to feature engineering and added new contextual information to the dataset:
I reran the test with these new features included. At first glance, global metric changes were minimal, and in some cases, even slightly worse. That’s expected: items with seasonal, promotional, or irregular sales patterns make up only a small portion of the total volume. In the aggregated results, they are outweighed by the rest of the assortment. So the slight worsening likely reflects statistical noise rather than a real drop in model quality. Visual inspection, however, confirmed clear improvements in forecasts for problematic items.
It’s also important to keep in mind that this is a stochastic problem – model outputs naturally vary between training runs. If your setup is correct, these variations should stay small – typically just a few percentage points.
| Metrics | Prediction | New prediction | ||
|---|---|---|---|---|
| Value (ALL) | Value (Item) | Value (ALL) | Value (Item) | |
| WAPE | 28.4178 | 42.0787 | 29.9001 | 39.1834 |
| RMSE | 46.3156 | 21.1877 | 52.8141 | 20.9628 |
| R² | 0.9004 | 0.9072 | ||
| MAPE | 52.4587 | 59.802 | ||
| ROBUST | 0.4986 | 59.7858 | 0.5259 | 62.4322 |
| STABLE | 0.3677 | 0.3702 | ||
IČO: 172 28 018
DIČ: CZ 172 28 018
Data Box ID: ykwdnxf
sales@neebile.cz
Jičínská 226/17, Praha, Žižkov, PSČ 130 00 Česká republika
(910) 658-2992
© 2025 Vytvořeno DigitalWays