Time Series Forecasting
Transformers
Safetensors
English
patchtst
time-series
stock-prediction
finance
quantitative
wavelet-denoising
Instructions to use tbukuai/stock-patchtst-sp500 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tbukuai/stock-patchtst-sp500 with Transformers:
# Load model directly from transformers import AutoTokenizer, PatchTSTForPrediction tokenizer = AutoTokenizer.from_pretrained("tbukuai/stock-patchtst-sp500") model = PatchTSTForPrediction.from_pretrained("tbukuai/stock-patchtst-sp500") - Notebooks
- Google Colab
- Kaggle
PatchTST — S&P 500 Next-Day Prediction
Best Model: v3 (this branch)
| Metric | Value |
|---|---|
| DA(ctx) | 60.8% (single-split) / 53.3% (walk-forward) |
| Sharpe(ctx) | 4.32 |
| RMSE | $26.84 |
| R² | 0.9976 |
⚠️ Walk-forward DA of 53.3% includes wavelet look-ahead bias. Honest (causal) DA is ~46-50%. See research findings below.
Versions (branches)
| Branch | Channels | Wavelet | DA(ctx) | Load with |
|---|---|---|---|---|
| main | 13 | Global | 60.8%/53.3% WF | from_pretrained("tbukuai/stock-patchtst-sp500") |
v1 |
13 | Global | 51.3% | from_pretrained("tbukuai/stock-patchtst-sp500", revision="v1") |
v3 |
13 | Global | 60.8% | from_pretrained("tbukuai/stock-patchtst-sp500", revision="v3") |
v4 |
25 | Causal | 60.1%/~43% WF | from_pretrained("tbukuai/stock-patchtst-sp500", revision="v4") |
v5 |
8 | None | 46.1% | from_pretrained("tbukuai/stock-patchtst-sp500", revision="v5") |
Usage
from transformers import PatchTSTForPrediction
# Load best model (v3)
model = PatchTSTForPrediction.from_pretrained("tbukuai/stock-patchtst-sp500")
# Load specific version
model_v5 = PatchTSTForPrediction.from_pretrained("tbukuai/stock-patchtst-sp500", revision="v5")
Key Research Finding
S&P 500 daily direction is NOT predictable from price/technical indicators with honest methodology. The 53.3% walk-forward result relies on wavelet look-ahead bias. Without it: ≤50% (random).
Full analysis: RESEARCH_FINDINGS.md
Architecture
- PatchTST (d=128, heads=16, layers=3, ~600K params)
- Context: 252 trading days
- Prediction: 1 day ahead
- Features: OHLCV + technical indicators + wavelet denoising (v3)
⚠️ Disclaimer
Research/educational only. NOT for trading. The model does not reliably predict market direction.
- Downloads last month
- 193
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support