📈 Time-Series Forecasting · Production ML · GCP
AI-Powered Sales
Forecasting Engine
Deployed a predictive ARIMA/SARIMAX forecasting model across 10 years of pharmaceutical sales data, driving a 5.3% sales increase through optimised inventory management and supplier-level intelligence.
ARIMA & SARIMAX
Time-Series
Python
PyCaret
GCP
Pandas · NumPy
Production Deployed · SLA-Based Quarterly Delivery on GCP
End-to-end forecasting pipeline operational · Serving 12-month forward projections · Integrated with inventory planning workflow
60%
Forecast Error Reduction
10yrs
Historical Data Processed
12mo
Forward Forecast Horizon
🎯 Business Problem
The client operated in pharmaceutical supply chain management where procurement decisions required reliable forward visibility into demand. Without it, the team regularly faced two failure modes: stockouts on high-margin products and overstock on slow-moving lines, both directly eroding profitability.
Manual forecasting was inconsistent, took significant analyst time, and failed to account for clear seasonality patterns already present in the data. The goal was to build a repeatable forecasting system that gave the procurement team reliable 12-month projections per supplier, along with actionable intelligence on margin trends and seasonal behaviour, delivered via Tableau dashboards built on top of BigQuery outputs.
🏗️ System Architecture
📊
Sales Data
10 Years Historical
Multi-Supplier
→
🐍
Data Pipeline
Python · Pandas
Classify & Prep
→
📈
ARIMA Model
ARIMA · SARIMAX
PyCaret Tuning
→
🔍
Supplier Analysis
Seasonality
Trend Detection
→
☁️
GCP
Production
Quarterly SLA
Output Layer: 12-month sales forecasts · Supplier seasonality profiles · Inventory planning recommendations
⚙️ Key Technical Challenges & Solutions
CHALLENGE
Complex multi-supplier data: millions of records across suppliers with inconsistent formats, missing periods, and different seasonal profiles that needed standardising before modelling.
SOLUTION
Structured data pipeline to classify, restructure, and prepare time-series data per supplier, ensuring clean, consistent input to the forecasting models.
CHALLENGE
Model selection across suppliers: ARIMA vs. SARIMAX performance varied significantly depending on each supplier's seasonality pattern and data volume.
SOLUTION
PyCaret-driven model experimentation comparing both approaches per supplier, ARIMA selected as optimal after parameter tuning, reducing MAE to 4–6%.
CHALLENGE
Historical anomaly distorting forecasts: one supplier showed an extreme dip in historical sales values that was skewing model parameters and degrading forecast accuracy.
SOLUTION
ARIMA order parameter tuning (p and q values) corrected for the anomaly, achieving significant improvement in both test set accuracy and the actual 12-month forward forecast for that supplier.
CHALLENGE
Delivery to business stakeholders: moving from ad-hoc analysis to a repeatable quarterly pipeline with outputs stored in BigQuery and surfaced via Tableau dashboards for procurement and commercial teams.
SOLUTION
Quarterly delivery pipeline on GCP producing forecasted sales values stored in BigQuery; the data visualisation team built Tableau dashboards on top for stakeholder consumption.
💡 What Makes This Different
10-Year Data Foundation
- Trained on a full decade of sales history per supplier
- Long-term seasonality and cyclical patterns captured accurately
- Historical anomaly corrected through ARIMA parameter tuning per supplier
Supplier-Level Intelligence
- Separate seasonality and margin trend profiles built per supplier
- Identified suppliers with declining margins and recovery signals
- Gave procurement a data-backed basis for supplier negotiations
Rigorous Model Selection
- ARIMA and SARIMAX both evaluated using PyCaret per supplier
- Forecast error reduced from 10–15% down to 4–6% MAE
- Parameters tuned per supplier, not a one-size-fits-all model
Production-Ready Delivery
- Forecasts delivered under quarterly SLA on GCP
- Replaced inconsistent manual forecasting with repeatable model projections
- Outputs handed directly to procurement with actionable supplier intelligence
🔍 Key Supplier Insights Delivered
Supplier 1, Stable Performer
- Clear seasonality with consistent monthly performance pattern
- Stable sales-margin ratio maintained over the long term
- Historical anomaly identified and corrected through model parameter tuning
Supplier 2, Margin Decline
- Strong seasonal patterns with moderate long-term margin decline
- Recent recovery signals identified in the latest data period
- Flagged for strategic renegotiation with the procurement team
Supplier 3, High Variability
- Pronounced seasonality with increasing monthly variability
- Significant margin pattern changes observed in recent years
- Recommended for a dynamic inventory adjustment strategy
🛠️ Technical Stack
📈ARIMA & SARIMAX
Time-Series Forecasting · Statsmodels
🧪PyCaret
Model Experimentation · Tuning
🐍Python · Pandas · NumPy
Data Processing · Feature Engineering
☁️GCP
Production Hosting · Quarterly SLA Delivery
📊Matplotlib · Seaborn · Plotly
Visualisation · Insight Reporting
📓Jupyter Notebook · VS Code
Development · Experimentation
📈 Business Impact
💰 +5.3% Sales Increase
- Directly attributed to better inventory alignment with demand signals
- Reduced stockouts on high-margin product lines
- Procurement decisions made weeks earlier with data-backed confidence
⚡ 60% Forecast Error Reduction
- MAE reduced from 10–15% range down to 4–6% across all suppliers
- Replaced inconsistent manual estimates with repeatable model projections
- Consistent accuracy maintained across all three supplier profiles
📊 Supplier & Competitive Intelligence
- Per-supplier seasonality profiles surfaced for the first time
- Declining margin patterns identified and flagged proactively
- Data-backed basis for supplier negotiations and contract reviews
⚠️ Disclaimer: This project serves as a Proof of Concept demonstrating how machine learning is applied in practice. No proprietary client data is disclosed.