Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🏭 Industrial Vending Machine Demand Forecasting

Predictive analytics project using 2 years of dispensing and restock data to optimize inventory management across a 5-machine vending network.


📌 Problem Statement

Industrial vending machines that dispense tools and supplies require accurate demand forecasting to minimize downtime and reduce operational costs. This project analyzes historical inventory and restocking data to forecast future demand and determine optimal restocking levels and timing.


📂 Dataset Overview

Dataset Rows Description
Inventory_Turnover.csv 38,982 Daily dispense events per SKU per device
Restock_data.csv 722 Restock orders with cost data per device
  • Time Period: February 2023 – February 2024 (2 years)
  • SKUs: 82 unique products
  • Devices: 5 vending machines

🔍 Project Structure

vending_analysis/
│
├── vending_analysis.ipynb     # Main analysis notebook
├── Inventory_Turnover.csv     # Dispense data
├── Restock_data.csv           # Restock data
├── plots/                     # Exported visualizations
└── README.md

📊 Analysis Sections

1. Data Cleaning & Preparation

  • Parsed date columns, validated data types
  • Verified zero missing values across both datasets
  • Confirmed all 5 device IDs match across datasets
  • Dropped redundant currency_code column (all USD)

2. Exploratory Data Analysis

  • Daily demand trends over 2 years
  • Total dispensed and restock cost by device
  • Top 15 SKUs by dispensing volume

3. Feature Engineering

  • Extracted day_of_week, month, week_number, year
  • Created lag feature (lag_1) per SKU
  • Built 7-day rolling average per SKU

4. Trends & Seasonality

  • Identified clear demand peak in late 2022 / early 2023
  • Significant demand drop mid-2023 (operational disruption)
  • Consistent monthly seasonal cycle confirmed via decomposition
  • Largely random residuals indicating good signal capture

5. Correlation Analysis

  • Weak correlation (0.33) between dispensing volume and restock cost
  • Negative correlation (-0.31) between dispense volume and restock frequency — high-demand machines restocked less often
  • Suggests restocking is not demand-driven

6. Demand Variability by SKU

  • CV range: 0.20 – 0.88 across all 82 SKUs
  • Even the most stable SKUs show meaningful variability (CV > 0.20)
  • Confirms static restocking schedules are insufficient across the entire network

7. Seasonality in SKU Demand

  • Top 3 SKUs show synchronized demand patterns
  • All SKUs experienced the same mid-2023 decline — points to an external operational event rather than product-specific issues
  • Linear regression confirms downward trend for top 2 SKUs; SKU 3 remained stable

8. Device Utilization

  • device_86bc: most efficient — ~500 units dispensed per restock visit
  • device_e5b5 and device_3686: least efficient — ~405 units per visit despite equal restock frequency
  • All 5 devices receive ~140 restock visits regardless of actual demand

🤖 Predictive Modeling

Stationarity Testing

  • ADF test on original series: p-value = 0.55 → non-stationary
  • Applied first-order differencing (d=1)
  • ADF test after differencing: p-value ≈ 0 → stationary confirmed

Parameter Selection

  • p = 6 → from PACF plot (6 significant lags)
  • d = 1 → from ADF test
  • q = 1 → from ACF plot (1 significant lag)

Model Comparison

Model MAE RMSE
MA(0,0,1) 107.80 159.08
AR(6,0,0) 81.80 142.13
ARMA(6,0,1) 75.44 137.71
ARIMA(6,1,1) 68.26 136.22

ARIMA(6,1,1) achieved the best performance with an MAE of 68.26 — approximately 18% error on average daily demand of ~380 units.


💡 Key Findings & Recommendations

  1. Demand is not stationary — fixed restocking schedules will consistently over or understock machines. A data-driven forecasting model is essential.

  2. Mid-2023 operational disruption — all SKUs and devices experienced a synchronized demand drop. Root cause investigation recommended.

  3. Restocking is not demand-driven — high-demand machines are restocked less frequently than low-demand machines. Restock triggers should be based on consumption thresholds, not fixed schedules.

  4. Device inefficiency — device_e5b5 and device_3686 are being visited as often as top performers but yielding 20% fewer units per visit. Inventory selection for these machines should be reviewed.

  5. High SKU volatility — all 82 SKUs have CV above 0.20. Dynamic par levels per SKU are recommended over blanket restocking policies.


🛠️ Tech Stack

  • Python 3 — pandas, numpy, matplotlib, seaborn
  • statsmodels — ARIMA, seasonal decomposition, ADF test, ACF/PACF
  • scikit-learn — MAE, RMSE evaluation metrics
  • Jupyter Notebook — analysis and documentation

🚀 How to Run

# Clone the repo
git clone https://github.com/tbhatti211-wq/vending-demand-forecasting

# Install dependencies
pip install pandas numpy matplotlib seaborn statsmodels scikit-learn jupyter

# Launch notebook
jupyter notebook vending_analysis.ipynb

👤 Author

Talib Bhatti
Data Analyst | GitHub | Southampton, NY

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages