Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- time-series
|
| 4 |
+
- finance
|
| 5 |
+
- itransformer
|
| 6 |
+
- onnx
|
| 7 |
+
- stock-prediction
|
| 8 |
+
license: mit
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# PutStrike iTransformer — Universal Stock Forecasting Model
|
| 12 |
+
|
| 13 |
+
**iTransformer** (ICLR 2024) trained on 90 stocks for 60-day price forecasting.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
- **Architecture**: iTransformer with RevIN (427,641 parameters)
|
| 18 |
+
- **Input**: 60 days × 83 features (OHLCV technicals + macro)
|
| 19 |
+
- **Output**: 60-day forward return forecast
|
| 20 |
+
- **Training**: 208,881 samples, walk-forward validation (70/15/15)
|
| 21 |
+
- **Loss**: HuberLoss(delta=0.02)
|
| 22 |
+
|
| 23 |
+
## Test Metrics
|
| 24 |
+
|
| 25 |
+
| Horizon | Directional Accuracy |
|
| 26 |
+
|---------|---------------------|
|
| 27 |
+
| 7-day | 59.7% |
|
| 28 |
+
| 14-day | 62.5% |
|
| 29 |
+
| 30-day | 68.9% |
|
| 30 |
+
| 60-day | 71.1% |
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
```python
|
| 34 |
+
import onnxruntime as ort
|
| 35 |
+
import numpy as np
|
| 36 |
+
|
| 37 |
+
session = ort.InferenceSession("itransformer.onnx")
|
| 38 |
+
# features shape: (1, 60, 83)
|
| 39 |
+
output = session.run(None, {"features": features})[0]
|
| 40 |
+
# output shape: (1, 60) — predicted returns
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Disclaimer
|
| 44 |
+
|
| 45 |
+
This model is for research and educational purposes only. Not financial advice.
|