5: Modeling - 7-teens/7-teens-DSA3101-2410-Project GitHub Wiki
Modeling Techniques Considered
To accurately predict demand and manage inventory levels, several modeling techniques were explored:
-
Classical Time Series Models:
- ARIMA: Suitable for stationary data, providing strong baseline forecasts. However, it struggles with seasonality and external regressors without significant pre-processing.
- SARIMA: Enhanced ARIMA with seasonality support, but computationally expensive and sensitive to parameter selection.
-
Machine Learning Models:
- Random Forest Regressor: Handles non-linear relationships and external regressors. However, lacks inherent time-series continuity modeling.
- XGBoost: Provides better handling of non-linearities and external variables but requires extensive feature engineering for time-related attributes.
-
Deep Learning Models:
- LSTM/GRU: Captures temporal dependencies effectively but demands large datasets and is computationally expensive.
- Temporal Fusion Transformer: Advanced deep learning model incorporating external features but requires extensive tuning.
-
Additive Time Series Models:
- Prophet: Handles seasonality, holidays, and external regressors natively. It is interpretable, robust to missing data, and quick to implement.
Model Selection Criteria
The chosen model needed to meet the following criteria:
- Interpretability: Clear insights into trends, seasonality, and external factor contributions.
- Scalability: Quick adaptability to varying datasets and time periods.
- Integration: Compatibility with inventory management use cases, including safety stock forecasting.
- Performance: Strong forecasting metrics (e.g., RMSE) and robustness in varied demand scenarios.
- Ease of Deployment: Should integrate seamlessly into existing pipelines without excessive overhead.
Prophet was selected as the best fit due to its native handling of seasonality, external regressors, and forecast interpretability.
Detailed Description of the Chosen Model
Model Overview
Prophet is an additive time-series forecasting model developed by Facebook. It decomposes time-series data into three main components:
- Trend: Models long-term increase or decrease in demand.
- Seasonality: Captures recurring patterns (e.g., weekly, yearly).
- Holidays/Events: Models demand fluctuations during specific dates or events.
Customizations
-
Incorporation of External Regressors:
- Holidays, promotions, and other business-specific factors were added as external regressors, allowing the model to adjust forecasts dynamically.
- Example: Campaign days were marked to observe their influence on demand spikes.
-
Dynamic Safety Stock Calculation:
- Used the upper bound of the forecast (
yhat_upper
) to derive a conservative estimate for safety stock, ensuring robustness against sudden demand surges.
- Used the upper bound of the forecast (
-
Handling Missing Data:
- Prophet’s ability to natively handle missing data reduced the need for imputation.
-
Daily Granularity with Flexible Forecasting Horizons:
- The model was trained on daily sales data and extended to monthly forecasts, making it suitable for short-term and long-term planning.
Pipeline Steps
-
Data Preprocessing:
- Aggregated daily sales data.
- Added external regressors (e.g., holidays, campaigns).
-
Model Training:
- Fitted the Prophet model with external regressors and seasonality parameters.
-
Forecast Generation:
- Generated future dates and included regressor values.
- Predicted
yhat
(expected demand) andyhat_upper
(for safety stock).
-
Visualization:
- Provided clear insights into trends, seasonality, and regressor impact.
- Dynamic inventory strategies based on the forecast.
Model Performance Metrics and Interpretation
Metrics
-
Root Mean Squared Error (RMSE):
- Quantifies the forecast deviation in the same units as the demand, ensuring interpretability.
- Achieved: RMSE within 10-15% of the demand timeframe predicted, indicating precise forecasting for the evaluation period.
-
Coverage:
- Represents the proportion of actual values falling within the forecast interval (
yhat_lower
toyhat_upper
). - Achieved: 95%+ coverage, ensuring high reliability and confidence in forecast predictions.
- Represents the proportion of actual values falling within the forecast interval (
-
Inventory Strategy Performance:
- Evaluated the suggested inventory strategy against existing approaches.
- The Prophet-based dynamic inventory strategy, using safety stock derived from forecast intervals, was compared against baseline inventory methods (e.g., fixed reorder points or static thresholds).
- Results:
- Improved stock-out prevention during demand surges.
- Reduced holding costs by maintaining optimal inventory levels.
- Enhanced responsiveness to dynamic demand changes, outperforming static strategies in terms of cost efficiency and customer satisfaction.
Interpretation
-
Trend and Seasonality Insights:
- The model effectively captured long-term trends and recurring seasonal patterns in demand, enabling businesses to plan procurement, marketing, and staffing with better accuracy.
-
Dynamic Inventory Management:
- By using forecast upper bounds (
yhat_upper
) to calculate safety stock, the model suggested a dynamic inventory strategy that adjusted reorder points and stock levels in real time. - This approach ensured a balance between minimizing holding costs and preventing stock-outs, addressing critical pain points in inventory management.
- By using forecast upper bounds (
-
Regressor Impact:
- External factors like promotions and campaigns were incorporated as regressors, providing granular insights into how these events influenced demand.
- This feature enabled preemptive adjustments in inventory and pricing strategies, aligning operations with demand-driving factors.
-
Cost and Revenue Optimization:
- The suggested inventory strategy not only reduced operational costs but also optimized revenue retention by maintaining adequate stock levels during peak periods.
- Compared to traditional static inventory approaches, the Prophet-driven strategy consistently outperformed by dynamically responding to forecasted demand variations.
Conclusion
The combination of accurate RMSE metrics, high coverage, and the proven effectiveness of the suggested inventory strategy underscores the reliability and utility of the Prophet model. This approach ensures that businesses are equipped to make data-driven decisions for inventory, pricing, and operational efficiency, resulting in significant cost savings and enhanced customer satisfaction.