Skip to content

Vani691/retail-forecasting-inventory-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛒 Retail Intelligent Replenishment System

Python FastAPI Streamlit Scikit-Learn

An end-to-end Machine Learning system designed to forecast retail demand and convert predictions into actionable, automated inventory decisions.

Final Dashboard

📌 Executive Summary

Retail supply chains frequently suffer from two opposing inefficiencies: stockouts (resulting in lost revenue) and overstocking (resulting in capital tied up in holding costs).

This project bridges the gap between predictive analytics and operations research by providing a complete intelligent forecasting and inventory optimization pipeline. It leverages machine learning to predict item-level demand and utilizes Operations Research (OR) formulas to calculate optimal Safety Stock, Reorder Points, and Economic Order Quantities (EOQ).

🏗️ System Architecture

graph TD;
    A[Raw Sales Data] --> B[Data Preprocessing];
    B --> C[Feature Engineering];
    C --> D[ML Forecasting Model XGBoost];
    D --> E[FastAPI Backend];
    F[Operations Research Engine] --> E;
    E --> G[Streamlit Web Dashboard];
    G --> H[Actionable Business Alerts];
Loading

🧠 Core Capabilities

  1. Machine Learning Demand Forecasting Time-Series Engineering: Automated generation of lag features, rolling statistics, and temporal variables.

Robust Modeling: Supervised learning approaches tracking actual vs. predicted sales with high fidelity.

Actual vs Predicted Sales

  1. Exploratory Data Analysis (EDA) Data integrity and underlying patterns were rigorously analyzed prior to modeling, isolating key sales drivers such as seasonality and promotional impacts.

Weekly Seasonality Weekly Pattern

Promotional Impact Promo Impact

  1. Inventory Optimization Engine Translates abstract predictions into concrete procurement metrics:

Safety Stock: Buffers against demand volatility.

Reorder Point (ROP): Triggers automated replenishment alerts.

Economic Order Quantity (EOQ): Minimizes total holding and ordering costs.

  1. Production-Ready Backend API Built on FastAPI, decoupling the machine learning engine from the frontend, allowing for highly scalable integration into existing ERP systems.

FastAPI Swagger UI

🚀 Installation & Deployment

  1. Clone the Repository Bash git clone https://github.com/Vani691/retail-forecasting-inventory-system.git

cd retail-forecasting-inventory-system

  1. Environment Setup Bash python -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate pip install -r requirements.txt

  2. Run the Backend API Start the FastAPI server to serve the ML models and optimization logic.

Bash uvicorn api.main:app --reload The Swagger UI documentation will be available at http://127.0.0.1:8000/docs

  1. Launch the Interactive Dashboard Open a new terminal window and run the Streamlit frontend.

Bash streamlit run app/app.py

📂 Project Structure

Retail-Intelligent-Replenishment-System/
├── api/
│   └── main.py                 # FastAPI application
├── app/
│   └── app.py                  # Streamlit dashboard
├── data/
│   ├── raw/                    # Simulated historical sales
│   └── processed/              # Cleaned & engineered datasets
├── images/                     # UI and EDA screenshots
├── notebooks/
│   └── eda.ipynb               # Exploratory data analysis
├── src/
│   ├── data_generator.py       # Synthetic data generation
│   ├── feature_engineering.py  # Lag & rolling metric creation
│   ├── forecasting.py          # Model training pipeline
│   └── inventory.py            # OR calculations (EOQ, ROP)
├── requirements.txt
└── README.md

💡 Future Roadmap

Real-time Streaming Integration: Migrate from batch processing to real-time inference using Apache Kafka.

Multi-Echelon Optimization: Expand the logic to handle warehouse-to-store routing.

Cloud Deployment: Containerize via Docker and deploy on AWS ECS / GCP Cloud Run.

👩‍💻 Developed By

Shravani Mane CSE-AIML Undergraduate | Machine Learning Developer | Building Data Science & ML Systems

LinkedIn GitHub

About

End-to-end retail analytics system for sales forecasting and inventory optimization using Machine Learning, FastAPI APIs, and Streamlit dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors