Forecasting tomorrow'spower use, hour by hour
It predicts tomorrow's hourly electricity use from free public data, and it beat Duke Energy's own forecast: 4.62% average error versus 4.95% (lower is better).
ENERGY AND UTILITIES
Too little power means blackouts. Too much wastes money.
Every day, the companies that run the power grid must guess how much electricity people will use tomorrow, hour by hour. They line up power plants based on that guess. Picture a cold January morning when millions of heaters switch on at once. Guess too low and they scramble for expensive emergency power, or risk blackouts. Guess too high and they pay for plants that sit idle.
These grid operators (the industry calls them balancing authorities) publish their own forecasts. This project asks a simple question: can a model built only from free public data match them?
The demo below shows real electricity use next to the operator's forecast, this model's forecast and its 90% range, for any test day.
Three grid operators: Florida Power & Light, Duke Energy Carolinas and the Tennessee Valley Authority (TVA).
No peeking at the answer
Each forecast uses only what was known the day before. That means the date and time, recent electricity use, and the weather forecast issued the day before. An automatic test checks that no later information sneaks in.
It also caught a mistake in the government data. One hour of TVA electricity use was reported as 9,971,121 megawatts, nearly 600 times the corrected figure of 16,915. Using the corrected figure cut the TVA forecast error from 16.49% to 3.84%. TVA's own forecast is still better, at 2.39%.
Results on six months it never saw
Scored on January to June 2026, data the model never saw while it was built. Error means how far off the forecast was on average, so lower is better.
Loading saved results.
One by one: we beat Duke Energy's own forecast (4.62% versus 4.95%). Florida Power & Light's forecast beat ours (3.23% versus 4.29%), and so did TVA's (2.39% versus 3.84%). All three of ours beat the simple method of copying the same hour last week, which was off by 11.22% to 13.50%.
ONLY WHAT WAS KNOWN THE DAY BEFORE
How it works
Four steps, all on free public data.
- Collect free public data
Hourly electricity use and the operators' own forecasts come from the U.S. Energy Information Administration (EIA), for 2024 to mid-2026. Archived weather forecasts come from a free weather service.
- Line up what was known the day before
For each hour of tomorrow: the date and time, electricity use a day and a week earlier, and the temperature forecast issued the day before. Real weather is never used.
- Learn from the past, test on the future
The model learns from 2024 to mid-2025, using late 2025 as a practice check. Then it forecasts January to June 2026, which it never saw.
- Show the misses too
Report the average error, how often it beats the operator, its worst days, and how often real use landed inside its 90% range.
Try it
Pick a grid operator and any day from January to June 2026. The chart shows real electricity use in megawatts (MW), next to the operator's forecast and ours. It replays saved results, so there is nothing to install or sign in to.
| Measure | Selected grid operator |
|---|
A fair test, losses included.
The code on GitHub downloads the data, runs the tests and the no-peeking check, and produces the exact saved results behind this page.
FOR ENGINEERS
Technical details
Data
EIA-930 Hourly Electric Grid Monitor six-month balance files, 2024 through 2026 H1 (US government, public domain). The loader prefers EIA's adjusted demand field: raw TVA demand has one corrupted hour of 9,971,121 MW that the adjusted field reports as 16,915 MW. Before that fix, TVA test MAPE was 16.49%. The operator comparison is EIA-930's day-ahead demand forecast column. Weather is the Open-Meteo Previous Runs API field temperature_2m_previous_day1 (forecast issued 24 h before valid time), one point per authority, CC BY 4.0.
Model and split
One LightGBM regressor per authority (L2 objective, learning rate 0.04, 31 leaves, early stopping after 30 rounds on validation; best iterations FPL 162, DUK 347, TVA 163). Features: hour, day of week, month, weekend flag, day-of-week sine and cosine, demand lags of 24 h and 168 h, and the previous-day temperature forecast. Time split with no shuffling: train 2024-01-01 to 2025-06-30, validation 2025-07-01 to 2025-12-31, test 2026-01-01 to 2026-06-30.
Evaluation (2026 H1 test)
MAPE over all test hours against the operator forecast and a same-hour-last-week baseline (168 h lag). 95% CI: 1,000 seeded bootstrap resamples of daily MAPE. Win rate: share of test days with lower daily MAPE than the operator. 90% prediction interval: 5th and 95th percentiles of validation residuals; coverage is the share of test hours inside it.
| % | FPL | DUK | TVA |
|---|---|---|---|
| Model MAPE | 4.29 | 4.62 | 3.84 |
| Operator MAPE | 3.23 | 4.95 | 2.39 |
| Last-week MAPE | 11.22 | 13.50 | 13.03 |
| 95% CI low | 3.86 | 4.27 | 3.56 |
| 95% CI high | 4.74 | 4.95 | 4.11 |
| Win rate | 43.09 | 28.73 | 20.99 |
| 90% coverage | 90.33 | 85.43 | 87.48 |
Leakage guard and limitations
Unit tests assert that every weather and feature issue timestamp is at least one day before the target hour, and that the loader prefers adjusted demand when the raw value is corrupted. Limitations: the EIA operator forecast column is treated as the operational comparison without reconstructing its publication time; one weather location per authority; the interval is a simple residual percentile band, not conformal, and under-covers for DUK and TVA. No LLM calls. Python, pandas, NumPy, LightGBM, requests and pytest.