Prediction of Energy Consumption of an Administrative Building using Machine Learning and Statistical Methods

Meryem El Alaoui, Laila Ouazzani Chahidi, Mohammed Rougui, Abdeghafour Lamrani, Abdellah Mechaqrane


Energy management is now essential in light of the current energy issues, particularly in the building industry, which accounts for a sizable amount of global energy use. Predicting energy consumption is of great interest in developing an effective energy management strategy. This study aims to prove the outperformance of machine learning models over SARIMA models in predicting heating energy usage in an administrative building in Chefchaouen City, Morocco. It also highlights the effectiveness of SARIMA models in predicting energy with limited data size in the training phase. The prediction is carried out using machine learning (artificial neural networks, bagging trees, boosting trees, and support vector machines) and statistical methods (14 SARIMA models). To build the models, external temperature, internal temperature, solar radiation, and the factor of time are selected as model inputs. Building energy simulation is conducted in the TRNSYS environment to generate a database for the training and validation of the models. The models' performances are compared based on three statistical indicators: normalized root mean square error (nRMSE), mean average error (MAE), and correlation coefficient (R). The results show that all studied models have good accuracy, with a correlation coefficient of 0.90 < R < 0.97. The artificial neural network outperforms all other models (R=0.97, nRMSE=12.60%, MAE= 0.19 kWh). Although machine learning methods, in general terms, seemingly outperform statistical methods, it is worth noting that SARIMA models reached good prediction accuracy without requiring too much data in the training phase.


Doi: 10.28991/CEJ-2023-09-05-01

Full Text: PDF


Energy Management; Tertiary Sector; Energy Prediction; Machine Learning; Statistical Methods.


Buildings & Energy Efficiency. (2023). Department of Housing and Urban Policy, Rabat, Morocco. Available online: (Accessed on April 2023).

Zhao, H. X., & Magoulès, F. (2012). A review on the prediction of building energy consumption. Renewable and Sustainable Energy Reviews, 16(6), 3586–3592. doi:10.1016/j.rser.2012.02.049.

Yokoyama, R., Wakui, T., & Satake, R. (2009). Prediction of energy demands using neural network with model identification by global optimization. Energy Conversion and Management, 50(2), 319–327. doi:10.1016/j.enconman.2008.09.017.

Ekici, B. B., & Aksoy, U. T. (2009). Prediction of building energy consumption by using artificial neural networks. Advances in Engineering Software, 40(5), 356–362. doi:10.1016/j.advengsoft.2008.05.003.

Yalcintas, M., & Akkurt, S. (2005). Artificial neural networks applications in building energy predictions and a case study for tropical climates. International Journal of Energy Research, 29(10), 891–901. doi:10.1002/er.1105.

Elbeltagi, E., & Wefki, H. (2021). Predicting energy consumption for residential buildings using ANN through parametric modeling. Energy Reports, 7, 2534–2545. doi:10.1016/j.egyr.2021.04.053.

Mohandes, S. R., Zhang, X., & Mahdiyar, A. (2019). A comprehensive review on the application of artificial neural networks in building energy analysis. Neurocomputing, 340, 55–75. doi:10.1016/j.neucom.2019.02.040.

Runge, J., & Zmeureanu, R. (2019). Forecasting energy use in buildings using artificial neural networks: A review. Energies, 12(17). doi:10.3390/en12173254.

Lu, C., Li, S., & Lu, Z. (2022). Building energy prediction using artificial neural networks: A literature survey. Energy and Buildings, 262, 111718. doi:10.1016/j.enbuild.2021.111718.

Dong, B., Cao, C., & Lee, S. E. (2005). Applying support vector machines to predict building energy consumption in tropical region. Energy and Buildings, 37(5), 545–553. doi:10.1016/j.enbuild.2004.09.009.

Culaba, A. B., Del Rosario, A. J. R., Ubando, A. T., & Chang, J. S. (2020). Machine learning-based energy consumption clustering and forecasting for mixed-use buildings. International Journal of Energy Research, 44(12), 9659–9673. doi:10.1002/er.5523.

Yu, Z., Haghighat, F., Fung, B. C. M., & Yoshino, H. (2010). A decision tree method for building energy demand modeling. Energy and Buildings, 42(10), 1637–1646. doi:10.1016/j.enbuild.2010.04.006.

Edwards, R. E., New, J., & Parker, L. E. (2012). Predicting future hourly residential electrical consumption: A machine learning case study. Energy and Buildings, 49, 591–603. doi:10.1016/j.enbuild.2012.03.010.

Li, Q., Meng, Q., Cai, J., Yoshino, H., & Mochida, A. (2009). Predicting hourly cooling load in the building: A comparison of support vector machine and different artificial neural networks. Energy Conversion and Management, 50(1), 90–96. doi:10.1016/j.enconman.2008.08.033.

Papadopoulos, S., Azar, E., Woon, W. L., & Kontokosta, C. E. (2018). Evaluation of tree-based ensemble learning algorithms for building energy performance estimation. Journal of Building Performance Simulation, 11(3), 322–332. doi:10.1080/19401493.2017.1354919.

Borowski, M., & Zwolińska, K. (2020). Prediction of cooling energy consumption in hotel building using machine learning techniques. Energies, 13(23), 6226. doi:10.3390/en13236226.

Dong, Z., Liu, J., Liu, B., Li, K., & Li, X. (2021). Hourly energy consumption prediction of an office building based on ensemble learning and energy consumption pattern classification. Energy and Buildings, 241, 110929. doi:10.1016/j.enbuild.2021.110929.

Alsharif, M. H., Younes, M. K., & Kim, J. (2019). Time series ARIMA model for prediction of daily and monthly average global solar radiation: The case study of Seoul, South Korea. Symmetry, 11(2). doi:10.3390/sym11020240.

Jeong, K., Koo, C., & Hong, T. (2014). An estimation model for determining the annual energy cost budget in educational facilities using SARIMA (seasonal autoregressive integrated moving average) and ANN (artificial neural network). Energy, 71, 71–79. doi:10.1016/

Camara, A., Feixing, W., & Xiuqin, L. (2016). Energy Consumption Forecasting Using Seasonal ARIMA with Artificial Neural Networks Models. International Journal of Business and Management, 11(5), 231. doi:10.5539/ijbm.v11n5p231.

Tarmanini, C., Sarma, N., Gezegin, C., & Ozgonenel, O. (2023). Short term load forecasting based on ARIMA and ANN approaches. Energy Reports, 9, 550–557. doi:10.1016/j.egyr.2023.01.060.

Sayed, H. A., William, A., & Said, A. M. (2023). Smart Electricity Meter Load Prediction in Dubai Using MLR, ANN, RF, and ARIMA. Electronics (Switzerland), 12(2), 389. doi:10.3390/electronics12020389.

Lamrani, A., & Rougui, M. (2018). Parametric Study of Thermal Renovation of an Administrative Building Envelope in Region of Chefchaouen (Morocco). 2018 6th International Renewable and Sustainable Energy Conference (IRSEC), Rabat, Morocco. doi:10.1109/irsec.2018.8702919.

Kandananond, K. (2011). Forecasting electricity demand in Thailand with an artificial neural network approach. Energies, 4(8), 1246–1257. doi:10.3390/en4081246.

Tatarkanov, A. A., Alexandrov, I. A., Chervjakov, L. M., & Karlova, T. V. (2022). A Fuzzy Approach to the Synthesis of Cognitive Maps for Modeling Decision Making in Complex Systems. Emerging Science Journal, 6(2), 368-381. doi:10.28991/ESJ-2022-06-02-012.

Zhang, Z. (2016). A gentle introduction to artificial neural networks. Annals of Translational Medicine, 4(19), 370. doi:10.21037/atm.2016.06.20.

Krenker, A., Bester, J., & Kos, A. (2011). Introduction to the Artificial Neural Networks. Artificial Neural Networks - Methodological Advances and Biomedical Applications. doi:10.5772/15751.

Ranganathan, A. (2004). The levenberg-marquardt algorithm. Tutorial on LM algorithm, 11(1), 101-110.

Rodrigues, F., Cardeira, C., & Calado, J. M. F. (2014). The daily and hourly energy consumption and load forecasting using artificial neural network method: A case study using a set of 93 households in Portugal. Energy Procedia, 62, 220–229. doi:10.1016/j.egypro.2014.12.383.

Taki, M., Abdanan Mehdizadeh, S., Rohani, A., Rahnama, M., & Rahmati-Joneidabad, M. (2018). Applied machine learning in greenhouse simulation; new application and analysis. Information Processing in Agriculture, 5(2), 253–268. doi:10.1016/j.inpa.2018.01.003.

Fidan, S., Oktay, H., Polat, S., & Ozturk, S. (2019). An Artificial Neural Network Model to Predict the Thermal Properties of Concrete Using Different Neurons and Activation Functions. Advances in Materials Science and Engineering, 2019, 1–13,. doi:10.1155/2019/3831813.

Sutton, C. D. (2005). Classification and Regression Trees, Bagging, and Boosting. Data Mining and Data Visualization, 303–329, Elsevier, Amsterdam, Netherlands. doi:10.1016/s0169-7161(04)24011-1.

MATLAB. (2023). Ensemble Algorithms - MATLAB & Simulink. Available online: ensemble-algorithms.html (accessed on April 2023).

Li, Q., Meng, Q., Cai, J., Yoshino, H., & Mochida, A. (2009). Applying support vector machine to predict hourly cooling load in the building. Applied Energy, 86(10), 2249–2256. doi:10.1016/j.apenergy.2008.11.035.

Fu, Y., Li, Z., Zhang, H., & Xu, P. (2015). Using Support Vector Machine to Predict Next Day Electricity Load of Public Buildings with Sub-metering Devices. Procedia Engineering, 121, 1016–1022. doi:10.1016/j.proeng.2015.09.097.

Wang, W., Xu, Z., Lu, W., & Zhang, X. (2003). Determination of the spread parameter in the Gaussian kernel for classification and regression. Neurocomputing, 55(3–4), 643–663. doi:10.1016/s0925-2312(02)00632-x.

Bounoua, Z., Ouazzani Chahidi, L., & Mechaqrane, A. (2021). Estimation of daily global solar radiation using empirical and machine-learning methods: A case study of five Moroccan locations. Sustainable Materials and Technologies, 28, 261. doi:10.1016/j.susmat.2021.e00261.

Laabid, A., Saad, A., & Mazouz, M. (2022). Integration of Renewable Energies in Mobile Employment Promotion Units for Rural Populations. Civil Engineering Journal, 8(7), 1406-1434. doi:10.28991/CEJ-2022-08-07-07.

Li, M. F., Tang, X. P., Wu, W., & Liu, H. Bin. (2013). General models for estimating daily global solar radiation for different solar radiation zones in mainland China. Energy Conversion and Management, 70, 139–148. doi:10.1016/j.enconman.2013.03.004.

Despotovic, M., Nedic, V., Despotovic, D., & Cvetanovic, S. (2016). Evaluation of empirical models for predicting monthly mean horizontal diffuse solar radiation. Renewable and Sustainable Energy Reviews, 56, 246–260. doi:10.1016/j.rser.2015.11.058.

Chahidi, L. O., Fossa, M., Priarone, A., & Mechaqrane, A. (2021). Evaluation of supervised learning models in predicting greenhouse energy demand and production for intelligent and sustainable operations. Energies, 14(19). doi:10.3390/en14196297.

Full Text: PDF

DOI: 10.28991/CEJ-2023-09-05-01


  • There are currently no refbacks.

Copyright (c) 2023 Meryem El Alaoui

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.