Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Retail World Model
|
| 2 |
+
|
| 3 |
+
A transformer-based world model for retail sales prediction, trained on the Favorita store sales dataset.
|
| 4 |
+
|
| 5 |
+
## Architecture
|
| 6 |
+
|
| 7 |
+
- **Encoder**: T5 Encoder processes historical retail time-series
|
| 8 |
+
- **Latent Dynamics**: LSTM-based world model that imagines future states
|
| 9 |
+
- **Decoder**: Predicts future sales with probabilistic forecasting (mean + variance)
|
| 10 |
+
- **Fine-tuning**: LoRA adapters on encoder attention layers
|
| 11 |
+
|
| 12 |
+
## Features
|
| 13 |
+
|
| 14 |
+
- **Context Window**: 60 days of historical sales data
|
| 15 |
+
- **Prediction Horizon**: 14 days of future sales forecasts
|
| 16 |
+
- **Inputs**: Sales history, promotion flags, day-of-week, month, product family
|
| 17 |
+
- **Output**: Probabilistic predictions with 90% confidence intervals
|
| 18 |
+
|
| 19 |
+
## Usage
|
| 20 |
+
|
| 21 |
+
### Training
|
| 22 |
+
```bash
|
| 23 |
+
python train_v4.py
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
### Inference
|
| 27 |
+
```bash
|
| 28 |
+
python inference.py --checkpoint /path/to/model --history history.csv --output predictions.csv
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## Dataset
|
| 32 |
+
|
| 33 |
+
- **Source**: [t4tiana/store-sales-time-series-forecasting](https://huggingface.co/datasets/t4tiana/store-sales-time-series-forecasting)
|
| 34 |
+
- **Stores**: 54 Favorita stores in Ecuador
|
| 35 |
+
- **Product Families**: 33 product categories
|
| 36 |
+
- **Records**: ~3M daily sales records (2013-2017)
|
| 37 |
+
|
| 38 |
+
## Model
|
| 39 |
+
|
| 40 |
+
- **Base**: T5 Encoder (tiny)
|
| 41 |
+
- **Parameters**: ~30M base + LoRA adapters
|
| 42 |
+
- **Loss**: Negative log-likelihood (probabilistic forecasting)
|
| 43 |
+
|
| 44 |
+
## References
|
| 45 |
+
|
| 46 |
+
- Chronos-2: Universal Time Series Forecasting (Amazon Science)
|
| 47 |
+
- iTransformer: Inverted Transformers for Time Series (NeurIPS 2023)
|
| 48 |
+
- TabFormer: Tabular Transformers for Sequential Data (IBM Research)
|