← Back to Projects
Machine Learning · Retail Analytics · Business Intelligence

Retail Demand Forecasting & Inventory Intelligence

16-Day Forecasting, Explainable Demand Risk & Power BI Decision Support

An end-to-end retail analytics case study built on Corporación Favorita data. The project forecasts demand across stores and product families, converts forecast behavior into explainable demand-risk priorities, and delivers the results through SQL Server and a seven-page Power BI decision-support report.

PythonPandasLightGBMXGBoostSQL ServerPower BIDAX
Retail Demand Forecasting & Inventory Intelligence — Executive Overview

Project at a Glance

54 × 33Stores × Product Families
28,51216-Day Forecast Rows
0.3942Selected Ensemble RMSLE
16.0%Lower Error vs Baseline

The Business Problem

Retail planners need to anticipate demand across many stores and product families before deciding where to focus inventory and replenishment attention. A forecast alone is not enough: management also needs to know which store-family combinations show unusual demand change, volatility, or uncertainty.

“How much should we expect to sell, where, and when — and which demand signals deserve immediate review?”

Data & Forecasting Scope

The source data contains more than 3 million historical daily sales rows. The final forecasting scope covers 54 stores, 33 product families and a 16-day horizon from 16–31 August 2017, producing 28,512 daily predictions across 1,782 Store × Family series.

Historical Sales

Daily store-family sales history with promotions, holidays, transactions and store metadata.

Leakage-Safe Features

Origin-time lags, rolling statistics, same-weekday history, calendar features, promotions and activity status.

Validation

Five time-ordered validation folds with a 16-day embargo to reflect the real forecast horizon.

Final Horizon

16 days, generating 28,512 predictions with no negative or missing forecast values.


End-to-End Workflow

Exploratory Data Analysis
↓
Leakage-Safe Feature Engineering
↓
Time-Ordered Model Validation
↓
LightGBM + XGBoost Ensemble Forecast
↓
Demand-Based Risk Engine
↓
SQL Server Analytics Layer
↓
Power BI Decision Support

Model Selection

Random Forest, LightGBM and XGBoost were evaluated across five time-ordered folds. The selected model is a 50/50 LightGBM + XGBoost blend because it delivered the best mean RMSLE among the tested models while beating the baseline across all five folds.

0.4693Same-Weekday Baseline RMSLE
0.3942Selected Ensemble RMSLE
5Time-Ordered Folds
16.0%Relative Error Reduction

Demand Risk Engine

The forecast is converted into an explainable 0–100 Demand Risk Score for every Store × Family series using four dimensions: demand surge, demand decline, volatility and forecast uncertainty. The result is a review category, action priority and recommended action.

1,782Series Assessed
304High + Critical
123P1 Immediate Review
48.657Average Risk Score

This is demand-based inventory attention, not a stockout or overstock prediction. The dataset does not contain inventory-on-hand, lead times, safety stock or reorder constraints.


Power BI Decision Support

01 — Executive Overview

Summarizes forecast volume, risk exposure, P1 actions, risk distribution and leading stores and product families.

Retail dashboard — Executive Overview
02 — Demand Forecast Analysis

Explores the 16-day forecast by date, store and family, including promotion-associated demand and detailed daily predictions.

Retail dashboard — Demand Forecast Analysis
03 — Demand Risk Command Center

Examines risk dimensions, distribution, Store × Family risk patterns and the highest-risk combinations.

Retail dashboard — Demand Risk Command Center
04 — Action Priority & Decision Support

Turns risk scores into operational review priorities and a filterable action register with recommended actions.

Retail dashboard — Action Priority and Decision Support
05 — Machine Learning Performance

Documents model comparison, fold-level RMSLE, feature gain shares and validation limitations.

Retail dashboard — Machine Learning Performance
06 — Store & Product Family Explorer

Provides an interactive view of demand, historical context, risk and recommended actions by store and family.

Retail dashboard — Store and Product Family Explorer
07 — Methodology & Project Documentation

Makes the forecasting assumptions, leakage controls, risk methodology and limitations explicit for reviewers.

Retail dashboard — Methodology and Project Documentation

Technology

PythonPandasscikit-learnLightGBMXGBoostSQL ServerPower BIDAXPower QueryGit


Historical Case Study

The analysis forecasts sales for 16–31 August 2017 using historical Corporación Favorita data. It is not live store monitoring. Risk scores are decision-support signals and should not be interpreted as direct purchasing quantities or inventory savings.