Update model card with benchmarks
Browse files
README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- time-series
|
| 6 |
+
- forecasting
|
| 7 |
+
- arima
|
| 8 |
+
- chronos
|
| 9 |
+
- lstm
|
| 10 |
+
- api
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# TSFA — Time Series Forecasting API
|
| 14 |
+
|
| 15 |
+
**Predict future values with calibrated confidence intervals via a simple REST API.**
|
| 16 |
+
|
| 17 |
+
TSFA handles the full forecasting pipeline: automatic preprocessing, model selection,
|
| 18 |
+
uncertainty quantification, and diagnostics — no ML expertise required.
|
| 19 |
+
|
| 20 |
+
## Available on RapidAPI
|
| 21 |
+
|
| 22 |
+
🚀 **[Try the API on RapidAPI](https://rapidapi.com/dorianmrt/api/tsfa)**
|
| 23 |
+
|
| 24 |
+
Free tier available. No credit card required to start.
|
| 25 |
+
|
| 26 |
+
## Quick Start
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
import requests
|
| 30 |
+
|
| 31 |
+
resp = requests.post(
|
| 32 |
+
"https://tsfa.p.rapidapi.com/v1/forecast/univariate",
|
| 33 |
+
headers={
|
| 34 |
+
"X-RapidAPI-Key": "YOUR_KEY",
|
| 35 |
+
"X-RapidAPI-Host": "tsfa.p.rapidapi.com",
|
| 36 |
+
},
|
| 37 |
+
json={
|
| 38 |
+
"series": [120, 132, 128, 145, 139, 152, 148, 160, 155, 168],
|
| 39 |
+
"horizon": 7,
|
| 40 |
+
"model": "auto",
|
| 41 |
+
},
|
| 42 |
+
)
|
| 43 |
+
print(resp.json()["forecast"]["mean"])
|
| 44 |
+
# [171.2, 174.5, 177.8, 181.0, 184.3, 187.6, 190.8]
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Models
|
| 48 |
+
|
| 49 |
+
| Model | Credits | Best For |
|
| 50 |
+
|-------|---------|----------|
|
| 51 |
+
| `auto` | 1 | Automatic selection — recommended |
|
| 52 |
+
| `arima` | 1 | Stationary series, interpretable |
|
| 53 |
+
| `chronos` | 1 | Pre-trained transformer (zero-shot) |
|
| 54 |
+
| `lstm` | 2 | Long sequences, complex patterns |
|
| 55 |
+
|
| 56 |
+
## Benchmarks
|
| 57 |
+
|
| 58 |
+
Evaluated via sliding-window backtesting (5 windows) on public datasets.
|
| 59 |
+
|
| 60 |
+
| Dataset | Model | Horizon | MAE | RMSE | MAPE | sMAPE |
|
| 61 |
+
|---------|-------|---------|-----|------|------|-------|
|
| 62 |
+
| ett_h1 | arima | 24 | 2.4524 | 2.9405 | 10.12% | 10.74% |
|
| 63 |
+
| exchange_rate | arima | 30 | 0.0085 | 0.0100 | 1.13% | 1.13% |
|
| 64 |
+
| m5_sample | arima | 14 | 9.0427 | 10.5617 | 7.63% | 7.43% |
|
| 65 |
+
|
| 66 |
+
Datasets: ETT-h1 (electricity transformer temperature), Exchange Rate (8 currencies),
|
| 67 |
+
M5 (retail sales). All results are out-of-sample.
|
| 68 |
+
|
| 69 |
+
## Endpoints
|
| 70 |
+
|
| 71 |
+
| Method | Path | Description |
|
| 72 |
+
|--------|------|-------------|
|
| 73 |
+
| POST | `/v1/forecast/univariate` | Forecast a single series |
|
| 74 |
+
| POST | `/v1/forecast/batch` | Forecast 50–500 series in parallel |
|
| 75 |
+
| POST | `/v1/validate` | Backtest with sliding-window cross-validation |
|
| 76 |
+
| GET | `/v1/models` | List available models |
|
| 77 |
+
| GET | `/v1/usage` | Check credit consumption |
|
| 78 |
+
| GET | `/health` | API health status |
|
| 79 |
+
|
| 80 |
+
## Plans
|
| 81 |
+
|
| 82 |
+
| Plan | Monthly Credits | Rate Limit | Price |
|
| 83 |
+
|------|----------------|------------|-------|
|
| 84 |
+
| BASIC | 500 | 10 req/min | $0 |
|
| 85 |
+
| PRO | 10,000 | 30 req/min | $49 |
|
| 86 |
+
| ULTRA | 50,000 | 100 req/min | $199 |
|
| 87 |
+
| MEGA | 200,000 | 300 req/min | $499 |
|
| 88 |
+
|
| 89 |
+
## License
|
| 90 |
+
|
| 91 |
+
MIT — see [LICENSE](./LICENSE)
|