YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Neuro-Symbolic AI Forecasting: The Symbolic Seam
What It Does
Combines neural forecasting (LSTM) with Knowledge Graph constraints via Quadratic Programming. Ensures predictions respect real-world limits β even during crises.
Key Results
| Condition | Neural Baseline | Symbolic Seam |
|---|---|---|
| Normal markets | RMSE 3.698 | RMSE 3.695 (identical) |
| Black Swan crisis | 95.33% violations | 6.00% violations β |
| Violations prevented | β | 938 / 1,050 |
How It Works
- System 1 (LSTM): Predicts prices from historical data
- System 2 (KG): Defines operational bounds (min/max price, daily change limit)
- Symbolic Seam: Projects forecast into constraint space using QP solver
Quick Start
pip install yfinance cvxpy torch pandas scikit-learn -q
jupyter notebook Neuro_Symbolic_Forecasting_Kaggle.ipynb
Dataset
- Source: Yahoo Finance (yfinance)
- Stocks: 50 S&P 500 stocks
- Period: Jan 2020 β Jan 2024
- Sequences: 48,800 (30-day windows)
Model
- LSTM: 64 hidden, 2 layers
- Training: 15 epochs, batch 64
- Best val loss: 0.000539
Key Findings
- Normal: Zero accuracy penalty (3.698 β 3.695 RMSE)
- Crisis: 89.33pp improvement in constraint compliance (95.33% β 6.00% violations)
- Per-stock: High-volatility stocks improve most (CRM +5.2%, DHR +1.7%)
Why This Matters
Neural models fail when rules change (tariffs, limits, regulations). Symbolic Seam enforces hard constraints at inference time without retraining.
Files
Neuro_Symbolic_Forecasting_Kaggle.ipynbβ Single notebook, all stagesIEEE_Symbolic_Seam_Full.docxβ Full research papermodels_backup_50stock.zipβ Trained model + config
Author
Sanaullah Tareen | PAF-IAST | @SanaullahTareen
Full details in IEEE paper or Kaggle notebook.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support