Electrical Load Forecasting — Pandemic vs Non-Pandemic Data
An LSTM grid-demand model that beat every benchmark at R² 0.61

What
A deep-learning model forecasting electrical grid feed-in power, trained and evaluated separately on pre-pandemic and pandemic-period data to test whether COVID-era demand shifts are actually learnable. The motivation is operational: inaccurate load forecasting undermines grid stability, capacity planning and cost management, and existing methods handle sudden regime changes poorly.
How
The dataset held 228,527 samples across 17 features (16 inputs plus grid feed-in in MW as the target), spanning December 2014 to July 2021.
Architecture: a 2-layer LSTM (64 → 32 units) with BatchNormalization and 0.2 dropout on both layers, into Dense(16, ReLU) and a single-unit output. Adam optimiser at a learning rate of 0.0005 with clipnorm 1.0, and EarlyStopping at patience 8 restoring best weights. Input sequence length of 96 steps (24 hours) forecasting 16 steps (4 hours) ahead.
Every configuration was benchmarked against decision-tree, multiple-linear-regression and simple-linear-regression baselines, each run in an A (pre-pandemic) and B (pandemic) variant so the regime effect could be isolated from model choice.
Outcome
The LSTM beat every baseline with a test R² of 0.6084 (0.8056 in training),
against 0.5757 for multiple linear regression and 0.4194 for linear regression.
MW_lag24 emerged as the single strongest predictor, confirming strong 24-hour
autocorrelation in demand.
Every model — not just the LSTM — performed worse on pandemic-period data, supporting the hypothesis that lockdown effects are measurable but genuinely harder to predict from history alone. A useful negative result also came out of preprocessing: IQR-based outlier capping proved unsuitable for the meteorological columns, arguing for domain-aware preprocessing in energy datasets. Recommended next steps were deeper LSTM stacks and predicting the full four-hour MW curve rather than a single point estimate, which would be more operationally useful for grid balancing.
Gallery
Click any image to enlarge