TFT-Lite -- Option Price Prediction (RegimeWise)
Part of RegimeWise -- A Deep Learning Option Pricing Framework (Phase 2: Baseline Model Comparison).
A dependency-free, pure-PyTorch Temporal Fusion Transformer ("TFT-Lite") that predicts SPY option
mark price from option-chain, Greek, and liquidity features. Built with a Variable Selection
Network, an LSTM encoder, and interpretable multi-head self-attention -- no pytorch_forecasting
/ pytorch_lightning dependency.
Data & preprocessing
Same dataset, feature set, and preprocessing as the project's LSTM baseline
(hf://datasets/major-year-project/stock-data/spy_options_2024.csv), with a 70/30 chronological
train/test split and 10-day per-contract input sequences.
Features (12): implied_volatility, delta, gamma, theta, vega, rho, tte_days, log_moneyness, strike, type_enc, volume, open_interest
Target: mark
Architecture
- Variable Selection Network (per-feature Gated Residual Networks + learned softmax weights)
- LSTM encoder (hidden size 64, 1 layer(s))
- Multi-head self-attention (4 heads) with gated residual skip connections
- Linear output head -> single-step
markprice prediction
Training
- Epochs: 30
- Optimizer: Adam (lr=0.001, weight_decay=1e-5), ReduceLROnPlateau
- Loss: MSE
- Batch size: 512
Test-set results (original price scale)
| Metric | Value |
|---|---|
| RMSE | 11.3021 |
| MAE | 5.4133 |
| R2 | 0.9843 |
Files
model.pt-- PyTorchstate_dictforTFTLite(seeconfig.jsonfor architecture args)feature_scaler.joblib,target_scaler.joblib-- fittedStandardScalers (train split only)config.json-- architecture + training configuration, needed to reconstruct the modelmetrics.csv,test_predictions.csv,feature_importance.csv-- evaluation outputs
- Downloads last month
- 29