IESO Coincident Peak Prediction — Model Training & Selection

This notebook trains and compares multiple approaches for predicting daily maximum Ontario demand:

The regression approach is expected to outperform classification because it avoids the extreme class imbalance problem (5 peaks out of 8,760 hours = 0.057%).

Train / Validation / Test Split

Split by base period boundary to prevent temporal leakage:

Approach A: Daily Max Demand Regression

Predict daily maximum Ontario Demand (MW) as a continuous quantity. Then derive peak day alerts by comparing predictions to the displacement threshold.

Approach B: Peak Day Classification

Binary classification with class imbalance handling. Included for comparison to demonstrate why regression is preferred.

Approach C: Threshold-Based Heuristic (Baseline)

Simple rule: alert if forecast max temp > 30°C AND is_weekday AND month in {6,7,8}. This represents what an experienced energy manager might do without a model.

Regression → Alert Conversion & Model Comparison

Convert regression predictions into RED/YELLOW/GREEN alerts using the displacement threshold, then evaluate peak detection performance.

SHAP Feature Importance Analysis

SHAP (SHapley Additive exPlanations) values quantify each feature's contribution to individual predictions. This reveals what drives the model's decisions.

Hyperparameter Tuning

Save Trained Model