Comparative study of deep learning architectures for S&P 500 stock price forecasting.
Baseline (stock_prediction_baseline.ipynb)
- MLP (2-layer, 256 hidden units)
- CNN (1D Conv with 64→128→256 channels)
- LSTM (2-layer, 256 hidden, bidirectional)
PatchTST (stock_prediction_patchtst.ipynb)
- Transformer-based architecture with patch tokenization
- RevIN (Reversible Instance Normalization) for distribution shift
- Config: 64 lookback, patch_len=8, stride=4, d_model=384, 8 heads, 5 layers
Technical indicators derived from OHLCV data:
- Momentum: RSI, MACD, ROC
- Volatility: ATR, Bollinger Bands
- Volume: OBV, VWAP
- Trend: ADX, EMA
S&P 500 historical data (5 years) from Kaggle.
pip install torch pandas pandas_ta matplotlib seabornRun notebooks in order:
stock_prediction_baseline.ipynb- Train baseline modelsstock_prediction_patchtst.ipynb- Train PatchTST with weighted ensemble
- RMSE (Root Mean Square Error)
- MAPE (Mean Absolute Percentage Error)
- Directional Accuracy
- R² Score
- Mohammad Farid Hendianto (2200018401)
- Fidyah Rahman (2200018185)
Kapita Selekta - Kelompok 3
📄 Read Full Academic Report (PDF)
Comprehensive analysis of PatchTST vs Baseline models, including methodology, architectural diagrams, and experimental results.
Copyright © 2026 Mohammad Farid Hendianto (IRedDragonICY).
Licensed under the Apache License, Version 2.0. See LICENSE for more details.