This project builds a retail demand forecasting workflow for weekly store sales and inventory planning. It uses synthetic Walmart-style data, trains a demand model, evaluates forecast errors, and converts those predictions into stock guidance for replenishment decisions.
- Forecast weekly sales by store
- Capture seasonality, promotions, and holiday demand effects
- Measure performance with RMSE, MAE, and R2
- Recommend inventory actions such as reorder or hold
src/data.py— synthetic generator and real retail transaction-to-weekly convertersrc/train.py— feature engineering and forecasting modelsrc/inventory.py— inventory recommendation logicapp.py— Streamlit dashboardtests/test_forecast.py— regression testsrequirements.txt— Python dependenciesreal_retail_sales.csv— public supermarket transaction data used by the real-data demo mode
python -m pip install -r requirements.txt.\.venv\Scripts\Activate.ps1
streamlit run app.py.\.venv\Scripts\Activate.ps1
pytest -q- Select real retail data, synthetic data, or upload your own CSV.
- Build features such as promotion flag, inventory on hand, holiday effects, and previous sales.
- Train a weekly sales model and evaluate error metrics.
- Translate predicted demand into recommended stock and reorder actions.
- Use the dashboard to monitor store planning decisions.
The real-data demo uses the public supermarket sales transaction dataset published in the
MohammedShehbazDamkar/Walmart-Sales-Data-Analysis--SQL-Project GitHub repository. The
transaction records are aggregated by branch and week before forecasting. Inventory is an
estimated planning field derived from weekly sales because the source dataset does not include
stock-on-hand records.