Forecasting is sold as a machine learning problem. For most Pakistani retailers and distributors it is a data quality problem, and the businesses that skip that step buy sophisticated models that produce confident nonsense.
What forecasting actually buys you
Two things, and it is worth being clear which one you need:
- Less capital tied up in stock. Most retailers carry too much of what does not sell and too little of what does. Better forecasts mean the same sales with less money sitting on shelves.
- Fewer stockouts on the items that matter. A stockout on a top selling line costs the sale and sometimes the customer.
Note that these pull in opposite directions. Before starting, decide which one is your actual problem, because the settings that reduce stockouts increase inventory and vice versa.
What you need before starting
At least a year of clean sales history
Two years is much better, because it lets the system see the same Ramadan, Eid and winter twice. Under a year, you cannot separate a seasonal pattern from a trend.
Sales by item by location by day
Not monthly totals. Not aggregated across branches. The detail is where the pattern lives, and aggregating it away before analysis is the most common preventable mistake.
A record of stockouts
This is the one almost nobody has, and it distorts everything. If an item sold zero units last Tuesday, was that no demand, or were you out of stock?
A forecast trained on sales rather than demand systematically under orders the items that sell out, which is precisely the wrong direction. If your system can flag days when stock was zero, that data is unusually valuable.
Clean item master data
Duplicate SKUs, the same product entered three ways, inconsistent units. Every forecasting project starts with this cleanup, and it is the part that takes the time. See why dirty item data breaks implementations.
Start with the simple method
For most businesses, a straightforward statistical approach captures the large majority of the achievable benefit:
- Moving average of recent sales, weighted toward the recent weeks.
- A seasonal factor per item or category, derived from last year.
- Safety stock based on how variable that item’s demand is and how long the supplier takes.
- A reorder point per item per location, with a purchase suggestion when it is breached.
This is arithmetic, not machine learning. It can be implemented inside a decent inventory system, it is explainable to the person doing the ordering, and explainability matters enormously: a purchase manager will override a number they do not understand, and then you have neither the forecast nor their judgement.
When machine learning genuinely helps
Once the simple method is running and trusted, models add value in specific situations:
- Many SKUs across many locations, where per item tuning by hand is impossible.
- Demand driven by external factors: weather for beverages and ice cream, cricket fixtures for snacks, exam season for stationery.
- Promotional effects, where a discount lifts sales of one item and cannibalises another.
- New products with no history, forecast from similar items rather than from their own past.
The honest summary: machine learning typically improves on a good statistical baseline by a useful margin. It does not rescue bad data, and it is not the first thing to buy.
The Pakistan specific factors
- Ramadan and Eid move each year against the Gregorian calendar, so a model that assumes annual seasonality by date will get them wrong. The dates must be supplied explicitly.
- Wedding season and winter drive large category shifts.
- Supply lead times are variable, particularly for imports. Safety stock must reflect the variability of the lead time, not just its average.
- Price and currency movement changes demand within a season, which breaks year on year comparisons.
How to measure whether it is working
Not overall accuracy, which is dominated by your slow moving long tail and tells you nothing useful.
- Forecast error on your top fifty items, which are most of your revenue.
- Stockout rate on those items.
- Inventory value and how many days of cover it represents, tracked over time.
- Write offs and expired stock.
- How often the purchase manager overrides the suggestion. A high override rate means the system is not trusted, and that is the real problem to solve.
How to start
- Clean the item master. This is the project.
- Get twelve months of sales by item by location by day into one place.
- Implement moving average with seasonality and safety stock. Run it alongside the current process for two months without acting on it.
- Compare. Where it was wrong, find out why. Usually it is a data problem rather than a method problem.
- Switch the top fifty items to system driven ordering first, then expand.
- Consider machine learning only after this is stable and trusted.
Frequently asked questions
How much sales history do I need?
Twelve months minimum, twenty four preferred so seasonal patterns appear twice. Less than twelve and you cannot distinguish season from trend.
Do I need machine learning?
Not to start. A weighted moving average with seasonality and proper safety stock captures most of the benefit and is explainable, which matters for adoption.
What is the biggest obstacle?
Dirty item data, followed by not knowing when items were out of stock. Both are fixable and both must be fixed before modelling.
Will the purchase manager use it?
Only if they understand it and it has been right for a couple of months alongside their own process. Run in parallel before switching.
Ezitech builds inventory, ERP and forecasting systems for retail, distribution and manufacturing. See our AI and analytics work or tell us what you stock.
