Skip to content

deepmhatre13/retailpulse-demand-intelligence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RetailPulse Demand Intelligence Platform

AI-powered retail demand forecasting, spike detection, inventory recommendation, and risk intelligence using XGBoost and the M5 Forecasting Dataset.

Overview

RetailPulse is a machine learning project designed to help retailers make proactive inventory and demand planning decisions. The platform combines forecasting, anomaly detection, and inventory intelligence into a unified retail analytics workflow.

Using historical sales, calendar events, and pricing information from the M5 Forecasting dataset, the system predicts future demand, identifies potential demand spikes, and generates inventory recommendations to reduce stockouts and overstock situations.


Problem Statement

Retail businesses frequently face challenges such as:

  • Unexpected demand surges
  • Inventory shortages
  • Overstocked products
  • Inaccurate demand forecasts
  • Poor replenishment planning

RetailPulse addresses these issues through predictive analytics and machine learning.


Core Features

Demand Forecasting

Predict future product demand using historical sales patterns and engineered time-series features.

Outputs

  • Demand forecasts
  • Trend analysis
  • Forecast accuracy metrics

Demand Spike Detection

Identify products likely to experience abnormal increases in demand.

Use Cases

  • Festival demand surges
  • Promotional campaigns
  • Seasonal demand shifts
  • Emerging product trends

Inventory Recommendation Engine

Generate inventory recommendations based on forecasted demand and risk signals.

Recommendations Include

  • Reorder suggestions
  • Inventory adjustments
  • Safety stock guidance
  • Restocking priorities

Retail Risk Intelligence

Assess operational risks using demand behavior and spike probabilities.

Risk Categories

  • Low Risk
  • Medium Risk
  • High Risk
  • Critical Risk

Dataset

This project uses the M5 Forecasting Accuracy Dataset, a large-scale retail forecasting dataset widely used for demand prediction research.

Data Sources

Sales Data

Historical daily product sales across multiple stores.

Calendar Data

Temporal features including:

  • Dates
  • Events
  • Holidays
  • Seasonal information

Price Data

Historical selling prices for products.


Machine Learning Pipeline

1. Data Loading

Load and merge:

  • Sales data
  • Calendar data
  • Price data

2. Data Transformation

Convert sales data into a time-series friendly format.

3. Feature Engineering

Generate predictive features including:

Temporal Features

  • Year
  • Month
  • Week
  • Day
  • Day of Week
  • Quarter
  • Weekend Indicator

Lag Features

  • Lag 7
  • Lag 28

Rolling Features

  • Rolling Mean 7
  • Rolling Mean 28
  • Rolling Standard Deviation

Price Features

  • Current Price
  • Price Changes

4. Exploratory Data Analysis

Analyze:

  • Demand trends
  • Product performance
  • Store performance
  • Category behavior
  • Seasonality patterns

5. Demand Forecasting Model

Algorithm

XGBoost Regressor

Objective

Predict future demand levels.

Evaluation Metrics

  • MAE (Mean Absolute Error)
  • RMSE (Root Mean Squared Error)

6. Spike Detection Model

Algorithm

XGBoost Classifier

Objective

Predict whether future demand will exceed expected thresholds.

Evaluation Metrics

  • Accuracy
  • Precision
  • Recall
  • F1 Score
  • ROC-AUC

7. Inventory Intelligence

Inventory recommendations are generated using:

  • Forecast demand
  • Historical demand
  • Demand variability
  • Spike probability

Project Architecture

Historical Sales Data
          │
          ▼
    Data Processing
          │
          ▼
 Feature Engineering
          │
          ▼
 ┌─────────────────┐
 │ Demand Forecast │
 └─────────────────┘
          │
          ▼
 ┌─────────────────┐
 │ Spike Detection │
 └─────────────────┘
          │
          ▼
 ┌─────────────────┐
 │ Risk Analysis   │
 └─────────────────┘
          │
          ▼
 ┌─────────────────┐
 │ Inventory Recs  │
 └─────────────────┘

Models Produced

Forecast Model

models/forecast_model.pkl

Used for demand forecasting.

Spike Detection Model

models/spike_detection_model.pkl

Used for spike probability estimation.


Repository Structure

retailpulse-demand-intelligence/

├── data/
│   ├── calendar.csv
│   ├── sales_train_validation.csv
│   ├── sell_prices.csv
│   └── feature_engineered_sales.csv
│
├── models/
│   ├── forecast_model.pkl
│   └── spike_detection_model.pkl
│
├── notebook/
│   └── RetailPulse_Demand_Intelligence_Platform.ipynb
│
├── requirements.txt
│
└── .gitignore

Installation

Clone Repository

git clone https://github.com/<your-username>/retailpulse-demand-intelligence.git

cd retailpulse-demand-intelligence

Install Dependencies

pip install -r requirements.txt

Launch Jupyter Notebook

jupyter notebook

Open:

notebook/RetailPulse_Demand_Intelligence_Platform.ipynb

Technologies Used

Data Analysis

  • Pandas
  • NumPy

Visualization

  • Matplotlib
  • Seaborn

Machine Learning

  • XGBoost
  • Scikit-Learn

Model Serialization

  • Pickle

Development Environment

  • Jupyter Notebook

Applications

RetailPulse can support:

  • Demand Planning
  • Inventory Optimization
  • Supply Chain Monitoring
  • Retail Analytics
  • Stockout Prevention
  • Sales Forecasting
  • Risk Management

Key Outcomes

  • Forecast future product demand
  • Detect unusual demand spikes
  • Recommend inventory actions
  • Identify operational risks
  • Improve replenishment decisions
  • Reduce stockouts and overstock situations

Future Enhancements

  • Deep Learning Forecasting Models
  • Multi-store Forecasting
  • Real-time Demand Monitoring
  • Automated Inventory Optimization
  • Explainable AI Insights
  • FastAPI Deployment
  • Enterprise Dashboard Integration

License

This project is intended for educational, research, and portfolio purposes.


Project

RetailPulse Demand Intelligence Platform

Forecast Demand • Detect Risks • Optimize Inventory

About

Retail demand forecasting, spike detection, inventory recommendation and risk intelligence using XGBoost and the M5 Forecasting dataset.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors