Tech/LightGBM V7

LightGBM V7

Dual gradient boosting model for temperature mean and variance prediction

Dual Model Architecture

The prediction engine runs two separate LightGBM models trained on historical weather data. The first model predicts the mean temperature for each station on a given date. The second model predicts the variance, capturing uncertainty in the forecast. Together, they define a Gaussian distribution over possible temperatures.

Mean model: regression objective, L2 loss
Variance model: regression on squared residuals
Both models share the same 38-feature input vector
Output: N(mu, sigma^2) per station per date

38 Engineered Features

Each prediction uses 38 carefully engineered features derived from ensemble weather forecasts, historical patterns, and temporal signals. Features include ensemble mean, spread, min/max across GFS, ECMWF, ICON, and GEM models, day-of-year cyclical encodings, station latitude/longitude, and rolling historical accuracy metrics.

Ensemble statistics: mean, std, min, max, range across 4 models
Temporal: day of year (sin/cos), hour, days until resolution
Geographic: latitude, longitude, elevation, coastal flag
Historical: 7-day rolling error, seasonal bias correction

Optuna Hyperparameter Tuning

Hyperparameters are optimized using Optuna with a Bayesian TPE sampler over 200 trials. The objective minimizes out-of-sample Brier score on calibrated bracket probabilities, ensuring the model is tuned end-to-end for the actual trading task rather than raw temperature accuracy.

200 Optuna trials with TPE sampler
Key params: num_leaves, learning_rate, min_child_samples, reg_alpha/lambda
5-fold temporal cross-validation (no data leakage)
Final model: Gaussian output feeds into CDF bracket mapping