Hierarchical ML Pipeline for trading predictions:
- Level 0: Attention Models (volatility/flow classification)
- Level 1: Base Models (XGBoost per symbol/timeframe)
- Level 2: Metamodels (XGBoost Stacking + Neural Gating)
Key components:
- src/pipelines/hierarchical_pipeline.py - Main prediction pipeline
- src/models/ - All ML model classes
- src/training/ - Training utilities
- src/api/ - FastAPI endpoints
- scripts/ - Training and evaluation scripts
- config/ - YAML configurations
Note: Trained models (*.joblib, *.pt) are gitignored.
Regenerate with training scripts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
2.2 KiB
Markdown
55 lines
2.2 KiB
Markdown
# Symbol-Timeframe Model Training Report
|
|
|
|
**Generated:** 2026-01-06 23:59:28
|
|
|
|
## Configuration
|
|
|
|
- **Training Data Cutoff:** 2024-12-31 (excluding 2025 for backtesting)
|
|
- **Dynamic Factor Weighting:** Enabled
|
|
- **Sample Weight Method:** Softplus with beta=4.0, w_max=3.0
|
|
|
|
## Training Results Summary
|
|
|
|
| Model | Symbol | Timeframe | Target | MAE | RMSE | R2 | Dir Accuracy | Train | Val |
|
|
|-------|--------|-----------|--------|-----|------|----|--------------| ----- | --- |
|
|
| XAUUSD_5m_high_h3 | XAUUSD | 5m | high | 0.925573 | 1.299031 | -0.0652 | 90.40% | 288433 | 50901 |
|
|
| XAUUSD_5m_low_h3 | XAUUSD | 5m | low | 0.853913 | 1.248952 | -0.0674 | 95.60% | 288433 | 50901 |
|
|
| XAUUSD_15m_high_h3 | XAUUSD | 15m | high | 1.573459 | 2.169436 | -0.0094 | 93.51% | 96882 | 17097 |
|
|
| XAUUSD_15m_low_h3 | XAUUSD | 15m | low | 1.536228 | 2.175787 | -0.0997 | 97.05% | 96882 | 17097 |
|
|
| EURUSD_5m_high_h3 | EURUSD | 5m | high | 0.000367 | 0.000615 | -0.0012 | 97.94% | 312864 | 55212 |
|
|
| EURUSD_5m_low_h3 | EURUSD | 5m | low | 0.000352 | 0.000593 | -0.0082 | 98.12% | 312864 | 55212 |
|
|
| EURUSD_15m_high_h3 | EURUSD | 15m | high | 0.000650 | 0.001053 | -0.0006 | 98.28% | 104710 | 18479 |
|
|
| EURUSD_15m_low_h3 | EURUSD | 15m | low | 0.000624 | 0.000990 | -0.0009 | 98.33% | 104710 | 18479 |
|
|
|
|
## Model Files
|
|
|
|
Models saved to: `/home/isem/workspace-v1/projects/trading-platform/apps/ml-engine/models/symbol_timeframe_models`
|
|
|
|
### Model Naming Convention
|
|
- `{symbol}_{timeframe}_high_h{horizon}.joblib` - High range predictor
|
|
- `{symbol}_{timeframe}_low_h{horizon}.joblib` - Low range predictor
|
|
|
|
## Usage Example
|
|
|
|
```python
|
|
from training.symbol_timeframe_trainer import SymbolTimeframeTrainer
|
|
|
|
# Load trained models
|
|
trainer = SymbolTimeframeTrainer()
|
|
trainer.load('models/symbol_timeframe_models/')
|
|
|
|
# Predict for XAUUSD 15m
|
|
predictions = trainer.predict(features, 'XAUUSD', '15m')
|
|
print(f"Predicted High: {predictions['high']}")
|
|
print(f"Predicted Low: {predictions['low']}")
|
|
```
|
|
|
|
## Notes
|
|
|
|
1. Models exclude 2025 data for out-of-sample backtesting
|
|
2. Dynamic factor weighting emphasizes high-movement samples
|
|
3. Separate models for HIGH and LOW predictions per symbol/timeframe
|
|
|
|
---
|
|
*Report generated by Symbol-Timeframe Training Pipeline*
|