File size: 1,120 Bytes
012ce04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# SARIMAX Model for M5 Demand Forecasting

## Overview
Seasonal ARIMA with eXogenous variables trained on aggregated daily M5 sales data.

## Model Details
- **Architecture**: SARIMAX(2,1,1)(1,1,1,7)
- **Training Data**: 1,913 days with 6 exogenous features
- **Test Period**: 28 days (2016-04-25 to 2016-05-22)
- **Exogenous Variables**: wday, month, snap_CA, snap_TX, snap_WI, has_event

## Performance
| Metric | Value |
|--------|-------|
| RMSE | 2,759.70 |
| MAE | 2,260.25 |
| MAPE | 4.98% |
| AIC | 35869.68 |

## Key Features
- Captures autocorrelation and seasonal patterns
- Exogenous variables provide additional signal
- Weekly seasonality (s=7) for day-of-week effects
- Event indicators (holidays, SNAP days) improve accuracy

## Usage
```python
import pickle
import pandas as pd

with open('model.pkl', 'rb') as f:
    model = pickle.load(f)

forecast = model.forecast(steps=28, exog=exog_future)
```

## Notes
- Best performance among the three statistical models
- Exogenous variables (especially SNAP indicators) significantly improve predictions
- Larger model size (85MB) due to seasonal components