Technical question
For day-ahead heating demand in a university building, is a deeper neural network worth the extra training time compared with a shallow network or logistic baseline?
Machine learning · Building energy · Forecasting · KTH
Comparison of logistic regression, shallow neural network (SNN) and deep neural network (DNN) for day-ahead space heating forecast of the KTH U-Building in Stockholm, using hourly weather and temporal features with Mahalanobis-based outlier filtering and systematic hyperparameter search.
Evidence dashboard
For day-ahead heating demand in a university building, is a deeper neural network worth the extra training time compared with a shallow network or logistic baseline?
The pipeline filtered sensor faults, removed multivariate outliers using Mahalanobis distance, normalised features and compared logistic regression, SNN and DNN architectures under the same train-test structure and hyperparameter search logic.
The DNN reached the highest test accuracy, but only by 0.33 percentage points over the SNN while taking roughly ten times longer to train and showing weaker validation behaviour.
Test accuracy: logistic regression 92.03%, SNN 93.39%, DNN 93.72%.
All models underpredicted rare heating peaks because MAE rewards mid-range accuracy. For deployment, the SNN is the stronger decision-support choice at this data scale; future work should use peak-sensitive metrics and more heating-season data.
Accurate day-ahead heating demand forecasts allow building operators and district heating networks to optimise production scheduling, reduce peak-load costs and improve integration of variable renewable supply. Physics-based building models are computationally expensive and require detailed building geometry and materials data; data-driven models offer a faster, more scalable alternative when metered data is available.
The goal was to compare three models of increasing architectural complexity on the same dataset and determine whether the additional compute cost of deeper networks is justified by the accuracy gain — a practically important question for energy management systems that need to run forecasts continuously.
The dataset comprised one year of hourly measurements from the KTH U-Building sensor network. Analysis was restricted to the heating season (1 October – 30 April) to avoid injecting summer cooling behaviour that would add noise without improving heating predictions.
Eight input features were used, combining direct sensor readings with three engineered temporal variables:
Variables closely correlated with the output — volumetric cooling flow, cooling demand — were intentionally excluded to avoid data leakage and to keep the model generalisable to buildings without those sub-meters.
The raw dataset had 5,112 hourly rows. Cleaning proceeded in two stages:
After cleaning, wind speed maximum dropped from 3,276.7 to 14.5 (units consistent with sensor range), and space heating minimum went from −155.92 kW to 1.26 kW, confirming the outlier removal was well-targeted. MinMaxScaler (scikit-learn) normalised all features to [0, 1] before model training.
All three models share the same forward-propagation / backpropagation / gradient-descent framework. The hyperparameter search space was identical across all models:
Two simplifying assumptions were applied to contain the search space: ReLU activation for all hidden layers (no activation-function tuning), and equal node count across all hidden layers in the DNN. The output layer used sigmoid in all models.
Optimal architectures found by trial and error:
The accuracy gap between SNN and DNN on the test set is only 0.33 percentage points, while the DNN takes 10× longer to train (7 s vs 0.69 s). Logistic regression trains in under 0.1 ms. From an energy management deployment perspective — where the model may run continuously or retrain daily — this runtime ratio strongly favours the SNN.
The DNN’s 2.2-percentage-point drop from test accuracy (93.72%) to validation accuracy (91.53%) on the January 12 validation day indicates the DNN has partially memorised the training distribution. The SNN’s test–validation gap is only 1.02 pp, confirming better generalisation. The conclusion is that SNN is the operationally preferred architecture for this task at this dataset scale.
All three models underpredict at extreme heating demand peaks. MAE as an optimisation metric weights all errors equally; large errors at rare peak-demand hours are outvoted by the large number of well-predicted mid-range hours. Two approaches were identified to address this:
Relevance
This project demonstrates the full data-science workflow for a building energy application: feature engineering from raw sensor data, multivariate outlier removal, normalisation, model comparison with systematic hyperparameter search, and a practically grounded recommendation based on both accuracy and computational cost. The finding — that the SNN outperforms the DNN on generalisation despite lower test accuracy, and does so 10× faster — is the kind of nuanced, operationally-relevant conclusion that distinguishes engineering analysis from benchmark-chasing.
The methodology is directly transferable to district heating load forecasting, demand-side flexibility scheduling, building energy management systems (BEMS), and any application where a fast-retraining model needs to run day-ahead predictions from weather and calendar inputs.