Data DAT-07 · Jun 2025
Forecasting a household's electricity consumption
Hour-by-hour forecast of a house's consumption from four years of measurements, comparing six models with naive baselines. Done during my semester at the West University of Timișoara, then corrected.

AThe question
Can we forecast a house's electricity consumption for the next hour from its history? And do machine learning models really do better than the simplest rule: repeating the previous hour's consumption?
BThe data
The UCI dataset “Individual household electric power consumption”: 2,075,259 measurements, one per minute, from a house in Sceaux between December 2006 and November 2010. It contains active and reactive power, voltage, current intensity and three sub-meters. 1.25% of the minutes are missing, in blocks of up to five days.
CThe method
Exploration reveals three cycles: consumption nearly doubles in winter and collapses every August, it peaks around 8 pm, and at weekends it stays high all day. The data is aggregated by hour, then each forecast relies on the previous 24 hours, the same hour the week before, the hour, the day and the month. Models learn on 2007 to 2009 and are evaluated on the eleven months of 2010. Linear regression, Random Forest, XGBoost, LightGBM, a neural network and seasonal ARIMA are compared with three naive baselines, with the same information for all.
DIn charts


EWhat I take from it
Random Forest, XGBoost and LightGBM come out level, with LightGBM training twenty times faster. The first version of the project concluded that the LSTM was promising without ever having evaluated the models. It also normalised the data over the whole period, test set included, and compared ARIMA under different conditions from the other models. Once these errors were fixed and a naive baseline added, the gain is real but modest: sudden peaks, when an appliance switches on, cannot be guessed from past consumption. The next variables to add would be the weather and the occupants' presence.