tiny-forecaster / README.md
limved's picture
Upload README.md with huggingface_hub
7aa3176 verified
|
Raw History Blame Contribute Delete
2.28 kB
---
license: mit
tags:
- time-series
- forecasting
- pytorch
- educational
---
# TinyForecaster
A **~72,000-parameter educational time-series forecasting model**, built to understand — by actually building one — how zero-shot time-series foundation models work at a small scale.
**This is not a production model.** It is not competitive with real time-series foundation models like Chronos, TimesFM, or [t0-alpha](https://huggingface.co/theforecastingcompany/t0-alpha). It was trained on 6,000 synthetic series for 20 epochs on a single CPU core. Full writeup, including an honest zero-shot benchmark against classical forecasting methods and a real foundation model, is in the [GitHub repo](https://github.com/Vedantl39/tiny-timeseries-foundation-model).
## What it does
Given a 96-timestep context window, predicts the next 42 timesteps — trained **only on synthetic data** (randomized trend, seasonality, noise, scale), never on real data, then evaluated zero-shot on real retail sales data.
## Architecture
A small patch-based transformer:
- Input context (96 steps) normalized by its own mean/std, split into 12 patches of 8 steps each
- 2-layer transformer encoder, 32-dim embeddings, 4 attention heads
- Linear head projects to a 42-step forecast, de-normalized back to the original scale
## Honest result
Zero-shot MAPE on a real, held-out 42-day retail sales forecast: **24.87%** — worse than every classical method (SARIMA, Prophet, Holt-Winters) tested against the same data, and far behind t0-alpha's 6.53%. The specific failure mode (missing hard periodic zero-value drops, because the synthetic training data never included that pattern) is documented in the GitHub repo — it's a more useful finding than the raw accuracy number.
## Usage
```python
import torch
from model import TinyForecaster # see github.com/Vedantl39/tiny-timeseries-foundation-model
model = TinyForecaster()
model.load_state_dict(torch.load("tiny_forecaster.pt"))
model.eval()
context = torch.tensor([...]) # shape (1, 96), your last 96 observed values
forecast = model(context) # shape (1, 42)
```
## Author
Vedant Limaye — built as a learning project after feedback from [Geoffrey Négiar](https://www.linkedin.com/in/geoffrey-negiar) (The Forecasting Company).