Files
ramseshk 7d7a67bd20 Add ML prediction pipeline — LightGBM, calibration fix, ensemble disagreement
Tier 1 ML enhancements:
- Feature engineering (37 features across 5 groups: thermal, dynamic,
  moisture, temporal, interaction) from NWP model output
- 7 LightGBM probability models for rain/temp/wind thresholds
- Temperature-scaled probabilities to prevent overconfidence on bootstrap data
- MLPredictor: unified inference pipeline replacing heuristic sigmoids
- Ensemble disagreement signals (composite spread → edge amplification)
- Fixed calibration loop: update_calibration() now functional (EMA of errors)
- record_outcome() wired for post-resolution feedback
- Nautilus strategy updated: ML predictions take priority, heuristics as fallback
- Historical backtest engine with Sharpe/ROI/max-DD simulation
- Bootstrap training data generator from HK climate normals

Run: python ml/train.py && python ml/backtest.py --edge 50
2026-08-10 17:50:07 +08:00

21 lines
499 B
Python

"""ML prediction pipeline for HK weather.
Usage:
from ml import MLPredictor
predictor = MLPredictor()
predictor.fetch_and_predict()
signal = predictor.generate_signal("temp_gt_30c_24h", market_probability=45.0)
"""
from ml.predictor import MLPredictor
from ml.model import ModelEnsemble, WeatherModel, TARGET_DEFINITIONS
from ml.features import FeatureEngine
__all__ = [
"MLPredictor",
"ModelEnsemble",
"WeatherModel",
"FeatureEngine",
"TARGET_DEFINITIONS",
]