Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Demand Forecasting Analysis

Overview

Benchmarked a regression-based demand forecast against a naive moving-average baseline across three top-volume product categories using two years of daily retail transaction data.

Note: Uses a synthetic Kaggle dataset (76,000 rows, daily granularity, Jan 2022–Jan 2024) for methodology demonstration.

Objective

Determine whether a lag/seasonality-based regression model meaningfully improves forecast accuracy over a simple moving-average baseline and identify where it does not.

Data

  • Source: Demand Forecasting Dataset, Kaggle
  • 76,000 rows across Date, Category, Region, Store and demand-driver fields (Price, Discount, Promotion, Weather, Seasonality)
  • Aggregated to daily category-level demand; top 3 categories by volume selected (Groceries, Clothing, Furniture)

Method

  1. Split into train (all data except last 30 days) and test (final 30 days) per category
  2. Baseline: flat forecast using the trailing 7-day average from training data
  3. Model: linear regression using lagged demand (1-day, 7-day), 7-day rolling average and day-of-week as features
  4. Evaluated both using Mean Absolute Error (MAE) on the held-out test period

Key Finding

The regression model cut forecast error by ~60% for Groceries (MAE 1,041.6 → 421.3) and Furniture (MAE 476.5 → 188.4) confirming these categories follow predictable trend and weekly-cycle patterns.

Clothing showed no improvement (MAE 230.2 vs. 230.7); its demand isn't explained by recent history or weekly seasonality alone, pointing to pricing or promotional activity as the likely driver instead.

Recommendation

Deploy the regression approach for Groceries and Furniture demand planning. For Clothing, incorporate price and promotion variables before relying on a trend-based forecast.

Visuals

Forecast vs Actual MAE Comparison

Tools

Python (Pandas, scikit-learn, NumPy, Matplotlib), Google Colab

Files

  • demand_forecasting_analysis.ipynb — full notebook
  • forecast_results_summary.csv — MAE results by category
  • forecast_vs_actual.png, mae_comparison.png — visuals

About

Time series demand forecasting; regression vs. baseline comparison across product categories. Python, Pandas, scikit-learn.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors