Demand Forecasting and Inventory Optimization for Retail StockoutsDemand Forecasting and Inventory Optimization for Retail Stockouts
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Demand Forecasting & Inventory Optimization — Cut Simulated Stockouts from 20% to 11% The Problem
A recurring pain point for retail and e-commerce businesses: how much stock to hold per product, and when to reorder — without either running out (lost sales) or over-ordering (wasted capital). I built this project end-to-end on a real 2-year, 1M+ row UK online retail transaction dataset to show how that decision can be made with data instead of guesswork.
What I Did
Cleaned 1M+ raw transactions: resolved cancellations, removed non-product entries, and separated one-off wholesale bulk orders from genuine recurring retail demand — a distinction that changed the shape of the demand data significantly.
Classified 1,760 products by revenue impact (ABC/Pareto analysis) and demand behavior (smooth, erratic, intermittent, lumpy — using the Syntetos-Boylan method from supply-chain statistics).
Backtested 9+ forecasting models — from simple moving averages to Croston's Method (for intermittent demand) to a global LightGBM model with quantile regression — using proper rolling-origin backtesting across 3 time periods, including the toughest case: the Q4 holiday demand surge.
Built a full inventory policy: safety stock and reorder points using both classical and non-parametric (quantile-based) methods, simulated against real held-out demand.
Delivered an interactive dashboard (built in HTML/JS, deployed live) so a non-technical stakeholder can explore any product's forecast, view inventory recommendations, and see model performance — no spreadsheet required.
Key Results
Identified that 21.6% of products drive 80% of revenue (classic Pareto effect) — informing where forecasting effort should focus.
Found that unrepeated wholesale bulk orders were distorting demand patterns for a subset of products, and built a cleaning method to separate wholesale noise from real retail demand.
Compared machine learning (LightGBM) against classical time-series methods honestly — reporting where ML wins, where it doesn't, and why (a well-tuned moving average performed comparably at the individual-product level).
Simulated the recommended inventory policy against real Q4 demand: cut stockout weeks from ~20% (naive rule) to ~11%, while explicitly weighing that against a fair (matched-service-level) comparison to a classical method — an honest, non-oversold conclusion.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started