File size: 1,548 Bytes
1be3595
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
# Retail World Model

A transformer-based world model for retail sales prediction, trained on the Favorita store sales dataset.

## Architecture

- **Encoder**: T5 Encoder processes historical retail time-series
- **Latent Dynamics**: LSTM-based world model that imagines future states
- **Decoder**: Predicts future sales with probabilistic forecasting (mean + variance)
- **Fine-tuning**: LoRA adapters on encoder attention layers

## Features

- **Context Window**: 60 days of historical sales data
- **Prediction Horizon**: 14 days of future sales forecasts
- **Inputs**: Sales history, promotion flags, day-of-week, month, product family
- **Output**: Probabilistic predictions with 90% confidence intervals

## Usage

### Training
```bash
python train_v4.py
```

### Inference
```bash
python inference.py --checkpoint /path/to/model --history history.csv --output predictions.csv
```

## Dataset

- **Source**: [t4tiana/store-sales-time-series-forecasting](https://huggingface.co/datasets/t4tiana/store-sales-time-series-forecasting)
- **Stores**: 54 Favorita stores in Ecuador
- **Product Families**: 33 product categories
- **Records**: ~3M daily sales records (2013-2017)

## Model

- **Base**: T5 Encoder (tiny)
- **Parameters**: ~30M base + LoRA adapters
- **Loss**: Negative log-likelihood (probabilistic forecasting)

## References

- Chronos-2: Universal Time Series Forecasting (Amazon Science)
- iTransformer: Inverted Transformers for Time Series (NeurIPS 2023)
- TabFormer: Tabular Transformers for Sequential Data (IBM Research)