Skip to content
ML Academy

project-030 · Deep learning · energy

Day-ahead household load: a 1-D CNN or GRU against seasonal naive and lag regression

A (hypothetical) energy retailer piloting demand response needs a day-ahead hourly load forecast for each enrolled household to plan flexibility offers. For one metered household, does a small sequence model (1-D CNN or GRU) reduce day-ahead hourly error enough over a seasonal-naive forecast and a lag regression to justify its extra complexity?

At a glance

  • Data

    Individual Household Electric Power Consumption (UCI) (public) · 2,075,259 one-minute rows × 9 variables, December 2006 to November 2010, one house in Sceaux near Paris; about 34-35 thousand hourly rows after aggregation

    Details on data
  • Baseline

    Three naive forecasts evaluated with the same backtest harness: same hour yesterday, same hour last week, and the mean of the same hour over the last four same weekdays.

    Details on baseline
  • Validation

    Train: December 2006 to December 2008. Validation: 2009 (one origin per day; used for tuning and early stopping). Test: January to November 2010, read once.

    Details on validation
  • Metric

    MAE in kW (primary), RMSE, MASE against the weekly naive, MAE by horizon hour (1-24) and by hour of day, evening-peak MAE (18:00-22:00).

    Details on metric

Success criterion

On a rolling-origin backtest over the 2010 test period (one origin per midnight, horizon 24 hours):

  • The selected model has MASE below 1 against the same-hour-last-week naive forecast.
  • A neural model is recommended only if it beats the lag regression on mean MAE with a paired block-bootstrap 95% interval (blocks of 7 origins) that excludes zero and is not worse on evening hours 18:00-22:00.
  • Otherwise the lag regression (or the naive forecast) is the recommendation, with the evidence.

Context

Day 37 (sequence state and its limits), Day 34 (training dynamics) and the Day 56 neural project. One household is a small, noisy target: consumption depends on occupancy and behaviour, and the dataset has no weather or occupancy covariates, so a large share of hourly variation is unforecastable from history alone. Keep strong simple baselines: on long-horizon benchmarks a one-layer linear model was competitive with Transformer forecasters (Zeng et al., 2023). CPU only: hourly aggregation leaves roughly 34-35 thousand rows, and a GRU with 32-64 hidden units on 168-hour windows trains in minutes.

Data

Dataset
Individual Household Electric Power Consumption (UCI) (public)
Licence
CC BY 4.0
Size
2,075,259 one-minute rows × 9 variables, December 2006 to November 2010, one house in Sceaux near Paris; about 34-35 thousand hourly rows after aggregation
Verification
identity verified

Access

Zip archive from the UCI dataset page (19.7 MB; extracts to a 126.8 MB semicolon-separated text file). No authentication. Cache the zip and record its SHA-256 on first download. Missing values appear as empty fields between separators per the UCI page; check how your parser reads them before casting to float. Fallback if blocked: a clearly labelled synthetic hourly series with daily and weekly seasonality to test the pipeline; do not report synthetic results as household results.

Grain

Raw grain: one minute. Modelling grain: one clock hour (mean active power in kW, equal to kWh in that hour). Forecast unit: one origin at 00:00 with 24 hourly targets for that day.

ColumnMeaning
Date, TimeDate in dd/mm/yyyy (day first) and time hh:mm:ss; local clock time zone not stated, so check around daylight-saving changes.
Global_active_powerHousehold minute-averaged active power in kW; the target after hourly averaging.
Global_reactive_power, Voltage, Global_intensityMinute-averaged reactive power (kW), voltage (V) and current (A); optional input channels, never future values.
Sub_metering_1, Sub_metering_2, Sub_metering_3Active energy in Wh for kitchen; laundry room; electric water heater and air conditioner.

EDA and data-quality rules

  • Parse dates day-first and assert that every month has plausible day counts; a month-day swap silently corrupts seasonality.

  • Quantify missing minutes per hour and list the longest gaps; an hourly value is valid only if at least 45 of 60 minutes are present, otherwise NaN.

  • Never interpolate the target across gaps longer than 2 hours, and never with values after the forecast origin.

  • Check for duplicated or missing clock hours around late March and late October (daylight-saving transitions).

  • Plot the mean daily profile by weekday and month, and scan for multi-day low-consumption periods (likely absences) to treat as a slice, not as noise to delete.

Baseline

Three naive forecasts evaluated with the same backtest harness: same hour yesterday, same hour last week, and the mean of the same hour over the last four same weekdays. The same-hour-last-week naive is also the MASE scale, computed on the training period (Hyndman and Koehler, 2006).

Features

Lag regression: the last 168 hourly values before the origin, rolling means over 24 and 168 hours, target hour, weekday, month and a French public-holiday flag (from the holidays package), as a direct 24-output model. Sequence models: an input window of shape (168, C) with power plus optional sub-metering and sine/cosine calendar channels, standardised with training-period statistics; missing inputs filled with zero after standardisation plus a binary mask channel; missing targets masked out of the loss.

Candidate methods

  • Ridge or LightGBM direct multi-output regression on lag and calendar features

    The classical model the neural one must beat; fast, inspectable and usually strong when seasonality dominates.

  • GRU (one layer, 32-64 hidden units) over the last 168 hours with a linear head to 24 outputs

    Recurrent state summarises the recent week; the Day 37 model. Watch for vanishing gradients over long windows and compare with shorter windows.

  • 1-D CNN (three dilated causal convolutions, kernel 3, dilations 1, 2, 4, then dense to 24 outputs)

    Parallel alternative to the GRU with a fixed receptive field; often trains faster on CPU. Pick one neural candidate for the studio.

Validation design

  • Train: December 2006 to December 2008. Validation: 2009 (one origin per day; used for tuning and early stopping). Test: January to November 2010, read once.
  • Each origin uses data up to 23:59 of the previous day only. Windows that straddle a split boundary are dropped.
  • Skip origins whose target day has more than 4 invalid hours, and report how many were skipped per model (the same set for all models).
  • Neural models: 3 seeds. For the test, refit on train plus validation with the tuned settings and a fixed number of epochs.
  • Paired comparisons use a block bootstrap over weeks of origins.

Leakage checks

Lags end strictly before the origin; no centred rolling windows; scaling statistics from the training period; no interpolation that uses values after the origin; sliding windows built after the split, not before; the test period read once.

Bias and representativeness

A single household cannot represent a customer base; any per-segment claim (dwelling type, heating type, tariff) is out of reach with this data. The 2006-2010 appliance mix also predates common heat pumps and electric vehicles. State both in the report.

Robustness checks

Report errors for origins right after long gaps, on holiday weeks and in low-consumption periods; add Gaussian noise to inputs and drop random input hours (masking) to see how each model degrades; report seed spread for neural models.

Technical metrics

MAE in kW (primary), RMSE, MASE against the weekly naive, MAE by horizon hour (1-24) and by hour of day, evening-peak MAE (18:00-22:00). Neural results as mean ± sd over seeds; paired block-bootstrap intervals for model differences.

Business interpretation

Demand-response events target evening peaks, so translate evening-peak energy error (kWh between 18:00 and 22:00) into a hypothetical cost of over- or under-committed flexibility, labelled as an assumption. Also report how often the model must fall back to naive because inputs are missing.

Error slices

  • Hour of day: evening peak 18:00-22:00 against night hours.

  • Weekday against weekend and French public holidays.

  • Winter against summer months.

  • Origins within 48 hours after a data gap, and low-consumption (likely absence) periods.

Implementation steps

  • Studio 0-20 min: parse, aggregate to hourly with the 45-minute coverage rule, produce the gap report and the daily-profile plot.

  • Studio 20-40 min: write one backtest function that takes any forecaster and returns per-origin, per-horizon errors; run the three naive baselines through it.

  • Studio 40-70 min: GRU or 1-D CNN. Assert input (N, 168, C) and output (N, 24) shapes, check the masked loss ignores NaN targets, overfit one batch, then train a few epochs on the training period.

  • Studio 70-90 min: compare on 2009 validation with MAE and MASE; decision-log entry.

  • Homework: lag regression candidate; 3 seeds; one learning-rate experiment; the 2010 test read once; slices and robustness; one-page report with the recommendation.

Reproduction

Pinned environment with a CPU build of PyTorch added to your own project (not in the academy environment). A download script that caches the zip and checks the recorded SHA-256; seeds for numpy and torch; one command that rebuilds the hourly table, runs the backtest for every model and writes per-origin errors to a CSV plus a summary table. Record wall time per model. No academy reference implementation.

Limitations

  • One household with no weather or occupancy data: most hour-level variation is behaviour, which history cannot forecast; results do not generalise to a customer portfolio.

  • Hourly averaging hides minute-level spikes that matter for local network constraints.

  • Local time zone and daylight-saving handling are not stated on the dataset page as checked; your handling is an assumption to document.

  • Data from 2006-2010; appliance mix and tariffs have changed since.

Production and monitoring

A real programme would fit one global model across many households rather than one model per house, and smart-meter data often arrive with a delay, so the forecast must be built from data available at the origin in production, not in the archive (a practitioner caution: check the actual feed latency). Monitor daily MAE against naive, the share of origins with missing inputs, and drift in the daily profile; fall back to the weekly naive automatically when inputs are incomplete.

Interview questions

  • Why use MASE with a weekly naive scale for hourly household load, and what does MASE above 1 tell you?

  • Your GRU beats seasonal naive but not ridge on lags. What do you report and recommend?

  • How do you build sliding training windows without leaking information across the validation boundary?

  • What changes in your design if meter data arrive 24 hours late?

Postmortem and alternatives

Note which model won by horizon: sequence models sometimes help in the first hours after the origin and fade later, while weekly naive stays hard to beat at longer horizons. If the neural model only ties the lag regression, the finding is that this target is dominated by daily and weekly repetition plus unforecastable behaviour. Alternatives: add temperature from a public weather archive (and its own availability issues), a global model across many households, or probabilistic forecasts (quantiles) because flexibility decisions care about the upper tail.

Rubric4 criteria

CriterionMeetsExceeds
Data handlingDay-first parsing, the 45-minute hourly coverage rule, a gap report, and no interpolation across the origin.Investigates the daylight-saving hours and shows the effect of the coverage rule on the metrics.
Backtest designOne harness for all models, midnight origins, the same skipped origins for every model, test read once.Per-horizon error curves and block-bootstrap intervals for the key comparison.
Neural model correctnessShape assertions, masked loss verified on a toy batch, one batch overfit, seeds reported.A learning-rate or window-length experiment with an explanation tied to vanishing gradients or receptive field.
DecisionRecommends a model against the success criterion, stating the one-household and no-weather limits.Quantifies the evening-peak business metric under stated assumptions and specifies the fallback rule.

References6