Smart Retail Demand & Inventory Optimization System

End-to-End ML Pipeline | 420K+ Records | 50 Stores | 500 Products
Keras | XGBoost | Selenium | MATLAB | SQL | FastAPI | Docker | AWS | MLflow | Tableau
Executive Overview
Demand Deep Dive
Model Performance
Inventory Optimizer
Total Records
420K+
Total Revenue
$48.2M
Avg Daily Demand
14.2
Best Model R²
0.93+
Stockout Risk Items
47

Revenue by Category

Demand by Region

Monthly Revenue Trend

Demand Distribution by Band

Demand by Category (Avg Units/Day)

Promotion Impact on Demand

Demand Volatility by Category

Weekend vs Weekday Demand

Category Demand Summary

CategoryAvg DemandRevenuePromo LiftVolatilityStockout Risk
Groceries25.4$8.2M+52%LowLow
Dairy22.1$6.8M+48%LowMedium
Beverages18.3$5.9M+55%MediumLow
Snacks15.0$5.1M+60%MediumLow
Frozen12.2$4.3M+45%MediumMedium
Personal Care8.5$3.8M+38%LowLow
Household7.1$3.4M+42%LowLow
Electronics4.2$4.1M+35%HighHigh
Clothing3.1$3.6M+30%HighMedium
Toys2.8$3.0M+70%HighHigh

Model Comparison

ModelTypeMAERMSEMAPETrain Time
LSTMKeras Sequential2.844.120.91812.4%45s
BiGRUKeras Bidirectional2.713.980.92411.8%52s
CNN-LSTMKeras Hybrid2.583.760.93311.1%48s
AttentionKeras Functional2.653.850.92811.5%55s
XGBoostGradient Boosting3.024.350.90813.1%8s
LightGBMGradient Boosting2.954.280.91212.8%5s
Best Model: CNN-LSTM (R² = 0.933, MAPE = 11.1%) — The CNN layer extracts local demand patterns while LSTM captures sequential trends. All models tracked via MLflow for experiment reproducibility.

R² Score Comparison

MAE Comparison

Feature Importance (XGBoost)

Algorithm Benchmarks

Key DSA Results: Binary search reorder = 2.1x faster | LRU cache = 50-100x speedup | Top-K heap = 3-5x faster | Prefix sum queries = 1000x+ vs naive scan
Current: 95%
Reorder Point
238
units
Safety Stock
52
units
Fill Rate
94.2%
Stockouts Reduced
~30%

DP Inventory Allocation by Store

Top-10 Stockout Risk Products

DSA Algorithm Performance Summary

OperationNaive ApproachOptimized (DSA)ComplexitySpeedup
Reorder Point SearchO(n log n) sort each timeO(log n) binary searchPre-sorted array2-8x
Forecast CachingRecompute every timeO(1) LRU cacheOrderedDict50-100x
Inventory AllocationGreedy heuristicO(nW) dynamic programmingBounded knapsackOptimal
Demand AnomalyRecompute window each stepO(n) sliding windowSingle passn/w x
Top-K StockoutO(n log n) full sortO(n log k) min-heapPriority queue3-5x
Range Demand QueryO(n) sum each timeO(1) prefix sumPre-computed1000x+
Bundle DetectionO(n²) brute forceO(n log n) two-pointerSorted + scan10-50x