Back to Projects

Sales Forecasting Engine
(Time-Series ML)

Reduced forecasting error (MAPE) from 14.1% → 8.3%, enabling accurate resource allocation and inventory planning

Type Time-Series · Forecasting
Stack Python · ARIMA · Prophet · SQL
Impact MAPE 8.3% · Accurate planning

Product Context

The business relied on manual sales forecasts based on historical averages and intuition. These forecasts had a Mean Absolute Percentage Error (MAPE) of 14.1%, leading to chronic issues:

Over-forecasting caused excess inventory and wasted resources. Under-forecasting led to stockouts and missed revenue. The operations team needed reliable, automated forecasts across multiple product lines and regions to enable proactive planning rather than reactive adjustments.

Data & Pipeline Design

Designed a modular forecasting pipeline that ingests historical sales data, applies preprocessing and feature extraction, and produces forecasts at daily/weekly/monthly granularity.

Sales Database
PostgreSQL
ETL Pipeline
Cleaning + aggregation
Feature Extraction
Temporal features
ARIMA / Prophet
Ensemble forecast
Forecast Output
Time-series predictions
Dashboard
Looker Studio

Modeling Approach

Evaluated multiple time-series models and built an ensemble approach combining statistical methods (ARIMA/SARIMA) with Facebook Prophet for capturing trend, seasonality, and holiday effects.

Models ARIMA/SARIMA for stationary series, Prophet for series with strong seasonality and holiday effects, weighted ensemble for final forecast
Challenges Multiple seasonalities (weekly, monthly, quarterly), holiday spikes, trend changes during promotions, missing data gaps
Features Day-of-week, month, quarter, lagged values (7/14/30 day), rolling averages, holiday indicators, promotion flags
Optimization Minimized MAPE across forecast horizons (7-day, 30-day), with backtesting on 12-month rolling window
Validation Walk-forward validation, residual analysis, prediction interval calibration (80% and 95%)

Forecast Dashboard

The forecast outputs are visualized in a Looker Studio dashboard showing actual vs. predicted trends, forecast confidence intervals, and error tracking by product line and region.

Current MAPE
8.3%
Previous MAPE
14.1%
Improvement
41%
Actual vs. Forecast (30-Day Window)
W1 W2 W3 W4 W5
Forecast
Actual
80% CI

Interactive Dashboard

This dashboard provides a clear view of revenue, costs, and profit trends over time. It supports financial decision-making by highlighting performance changes, category breakdowns, and geographic distribution.

Finance Dashboard Preview
View Interactive Dashboard →

Key Findings

  • Weekly seasonality was the strongest signal — Monday/Tuesday consistently under-indexed while Thursday/Friday peaked
  • Prophet's holiday component captured promotion-driven spikes that ARIMA alone couldn't model
  • The ensemble approach reduced error most in volatile product lines where single models diverged significantly
  • Forecast accuracy degraded beyond 14 days — operational planning was redesigned around 7-day rolling forecasts

How forecasts drove action

The forecasting engine became the input layer for operations planning. Inventory was pre-positioned based on 7-day rolling forecasts. Staff scheduling aligned with predicted demand peaks. Marketing promotions were timed around forecast valleys to smooth demand curves.

The key shift: from "what happened last month" to "what will happen this week" as the basis for resource decisions.

Business Impact

MAPE Reduction
14.1% → 8.3%
41% improvement in accuracy
Planning Horizon
7-day
Rolling automated forecasts
Overstock Reduction
↓ 23%
Less wasted inventory

Reflections

"The most impactful decision wasn't choosing between ARIMA and Prophet — it was deciding the forecast horizon. We initially built for 30-day forecasts, but accuracy dropped sharply past 14 days. By shifting to 7-day rolling forecasts aligned with the business cadence, we delivered dramatically more useful predictions. The lesson: match the model's capability to the decision it supports."