# Analysis of the Integration of Drift Detection Methods in Learning Algorithms for Electrical Consumption Forecasting in Smart Buildings

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{8}

^{9}

^{10}

^{*}

## Abstract

**:**

_{2}emissions in recent years. Although there have been notable advances in energy efficiency, buildings still have great untapped savings potential. Within demand-side management, some tools have helped improve electricity consumption, such as energy forecast models. However, because most forecasting models are not focused on updating based on the changing nature of buildings, they do not help exploit the savings potential of buildings. Considering the aforementioned, the objective of this article is to analyze the integration of methods that can help forecasting models to better adapt to the changes that occur in the behavior of buildings, ensuring that these can be used as tools to enhance savings in buildings. For this study, active and passive change detection methods were considered to be integrators in the decision tree and deep learning models. The results show that constant retraining for the decision tree models, integrating change detection methods, helped them to better adapt to changes in the whole building’s electrical consumption. However, for deep learning models, this was not the case, as constant retraining with small volumes of data only worsened their performance. These results may lead to the option of using tree decision models in buildings where electricity consumption is constantly changing.

## 1. Introduction

- Integration of drift detection methods to a multi-step forecasting strategy that forecasts the next 24 h from any hour of the day.
- An analysis of the integration of drift detection methods in decision trees and deep learning algorithms for forecasting the electricity consumption of the entire building.
- Comparison analysis between active and passive drift detection methods for building electricity consumption forecasting in smart buildings.

## 2. Methodology and Approach

#### 2.1. Datasets Construction

#### 2.2. Approach and Forecasting Algorithms

#### 2.3. Drift Detection Methods

_{0}, W

_{1}) used to decide whether a change has occurred. ADWIN contrasts the median of W

_{0}and W

_{1}to affirm that they coincide with a similar distribution. Concept drift is identified assuming the distribution correspondence does not hold anymore. After recognizing a drift, W

_{0}is changed by W

_{1}and a new W

_{1}is introduced. ADWIN utilizes a certainty value $\delta \in \left(0,1\right)$ to decide whether the two sub-windows coincide with a similar dispersion [42].

#### 2.4. Performace Metrics

^{2}) were used.

^{2}is a statistical measure of the variance between estimated values acquired by the model and real values (level of direct relationship among anticipated and estimated values) [46], which is determined according to Equation (5).

^{2}, it was selected to know how the data fit the models.

## 3. Experimentation Setup

## 4. Results and Discussion

#### 4.1. Decision Trees Models Evaluation

^{2}metrics, the passive method does not clearly show that it obtains better performance than the KSWIN method in the case of XGBoost.

#### 4.2. Deep Learning Models Evaluation

^{2}metrics.

^{2}metrics, the KSWIN method obtained better performance than the model without DDM.

^{2}metrics for CNN with DDM. Which would suggest that the type of change in the data distribution is not abrupt enough to require the retraining of the deep learning models.

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- IEA Tracking Buildings. 2021. Available online: https://www.iea.org/reports/tracking-buildings-2021 (accessed on 16 March 2022).
- Cholewa, T.; Siuta-Olcha, A.; Smolarz, A.; Muryjas, P.; Wolszczak, P.; Guz, Ł.; Bocian, M.; Balaras, C.A. An easy and widely applicable forecast control for heating systems in existing and new buildings: First field experiences. J. Clean. Prod.
**2022**, 352, 131605. [Google Scholar] [CrossRef] - Devagiri, V.M.; Boeva, V.; Abghari, S.; Basiri, F.; Lavesson, N. Multi-view data analysis techniques for monitoring smart building systems. Sensors
**2021**, 21, 6775. [Google Scholar] [CrossRef] [PubMed] - Izidio, D.M.; de Mattos Neto, P.S.; Barbosa, L.; de Oliveira, J.F.; Marinho, M.H.D.N.; Rissi, G.F. Evolutionary hybrid system for energy consumption forecasting for smart meters. Energies
**2021**, 14, 1794. [Google Scholar] [CrossRef] - Hong, T.; Wang, Z.; Luo, X.; Zhang, W. State-of-the-art on research and applications of machine learning in the building life cycle. Energy Build.
**2020**, 212, 109831. [Google Scholar] [CrossRef] [Green Version] - Kim, J.Y.; Cho, S.B. Electric energy consumption prediction by deep learning with state explainable autoencoder. Energies
**2019**, 12, 739. [Google Scholar] [CrossRef] [Green Version] - Zeng, A.; Ho, H.; Yu, Y. Prediction of building electricity usage using Gaussian Process Regression. J. Build. Eng.
**2020**, 28, 101054. [Google Scholar] [CrossRef] - Xu, W.; Peng, H.; Zeng, X.; Zhou, F.; Tian, X.; Peng, X. A hybrid modelling method for time series forecasting based on a linear regression model and deep learning. Appl. Intell.
**2019**, 49, 3002–3015. [Google Scholar] [CrossRef] - Cholewa, T.; Siuta-Olcha, A.; Smolarz, A.; Muryjas, P.; Wolszczak, P.; Anasiewicz, R.; Balaras, C.A. A simple building energy model in form of an equivalent outdoor temperature. Energy Build.
**2021**, 236, 110766. [Google Scholar] [CrossRef] - Žliobaitė, I.; Pechenizkiy, M.; Gama, J. An Overview of Concept Drift Applications BT—Big Data Analysis: New Algorithms for a New Society; Japkowicz, N., Stefanowski, J., Eds.; Springer International Publishing: Cham, Switzerland, 2016; pp. 91–114. ISBN 978-3-319-26989-4. [Google Scholar]
- Iwashita, A.S.; Papa, J.P. An Overview on Concept Drift Learning. IEEE Access
**2019**, 7, 1532–1547. [Google Scholar] [CrossRef] - Baier, L.; Kühl, N.; Satzger, G.; Hofmann, M.; Mohr, M. Handling concept drifts in regression problems—the error intersection approach. In WI2020 Zentrale Tracks; GITO Verlag: Berlin, Germany, 2020; pp. 210–224. [Google Scholar]
- Kahraman, A.; Kantardzic, M.; Kahraman, M.; Kotan, M. A data-driven multi-regime approach for predicting energy consumption. Energies
**2021**, 14, 6763. [Google Scholar] [CrossRef] - Webb, G.I.; Lee, L.K.; Goethals, B.; Petitjean, F. Analyzing concept drift and shift from sample data. Data Min. Knowl. Discov.
**2018**, 32, 1179–1199. [Google Scholar] [CrossRef] - Lu, J.; Liu, A.; Dong, F.; Gu, F.; Gama, J.; Zhang, G. Learning under Concept Drift: A Review. IEEE Trans. Knowl. Data Eng.
**2019**, 31, 2346–2363. [Google Scholar] [CrossRef] [Green Version] - Brzezinski, D.; Stefanowski, J. Reacting to different types of concept drift: The accuracy updated ensemble algorithm. IEEE Trans. Neural Netw. Learn. Syst.
**2014**, 25, 81–94. [Google Scholar] [CrossRef] [Green Version] - Wadewale, K.; Desai, S.; Tennant, M.; Stahl, F.; Rana, O.; Gomes, J.B.; Thakre, A.A.; Redes, E.M.; Padmalatha, E.; Rani, P.; et al. Survey on Method of Drift Detection and Classification for time varying data set. Comput. Biol. Med.
**2016**, 32, 1–7. [Google Scholar] - Khezri, S.; Tanha, J.; Ahmadi, A.; Sharifi, A. A novel semi-supervised ensemble algorithm using a performance-based selection metric to non-stationary data streams. Neurocomputing
**2021**, 442, 125–145. [Google Scholar] [CrossRef] - Fekri, M.N.; Patel, H.; Grolinger, K.; Sharma, V. Deep learning for load forecasting with smart meter data: Online Adaptive Recurrent Neural Network. Appl. Energy
**2021**, 282, 116177. [Google Scholar] [CrossRef] - Jagait, R.K.; Fekri, M.N.; Grolinger, K.; Mir, S. Load Forecasting Under Concept Drift: Online Ensemble Learning With Recurrent Neural Network and ARIMA. IEEE Access
**2021**, 9, 98992–99008. [Google Scholar] [CrossRef] - Fenza, G.; Gallo, M.; Loia, V. Drift-aware methodology for anomaly detection in smart grid. IEEE Access
**2019**, 7, 9645–9657. [Google Scholar] [CrossRef] - Mehmood, H.; Kostakos, P.; Cortes, M.; Anagnostopoulos, T.; Pirttikangas, S.; Gilman, E. Concept drift adaptation techniques in distributed environment for real-world data streams. Smart Cities
**2021**, 4, 349–371. [Google Scholar] [CrossRef] - Ceci, M.; Corizzo, R.; Japkowicz, N.; Mignone, P.; Pio, G. ECHAD: Embedding-Based Change Detection from Multivariate Time Series in Smart Grids. IEEE Access
**2020**, 8, 156053–156066. [Google Scholar] [CrossRef] - Yang, Z.; Al-Dahidi, S.; Baraldi, P.; Zio, E.; Montelatici, L. A Novel Concept Drift Detection Method for Incremental Learning in Nonstationary Environments. IEEE Trans. Neural Netw. Learn. Syst.
**2020**, 31, 309–320. [Google Scholar] [CrossRef] [PubMed] - Silva, R.P.; Zarpelão, B.B.; Cano, A.; Barbon Junior, S. Time series segmentation based on stationarity analysis to improve new samples prediction. Sensors
**2021**, 21, 7333. [Google Scholar] [CrossRef] [PubMed] - Heusinger, M.; Raab, C.; Schleif, F.M. Passive concept drift handling via variations of learning vector quantization. Neural Comput. Appl.
**2022**, 34, 89–100. [Google Scholar] [CrossRef] - Raab, C.; Heusinger, M.; Schleif, F.M. Reactive Soft Prototype Computing for Concept Drift Streams. Neurocomputing
**2020**, 416, 340–351. [Google Scholar] [CrossRef] - Togbe, M.U.; Chabchoub, Y.; Boly, A.; Barry, M.; Chiky, R.; Bahri, M. Anomalies detection using isolation in concept-drifting data streams. Computers
**2021**, 10, 13. [Google Scholar] [CrossRef] - Moon, J.; Park, S.; Rho, S.; Hwang, E. A comparative analysis of artificial neural network architectures for building energy consumption forecasting. Int. J. Distrib. Sens. Netw.
**2019**, 15, 155014771987761. [Google Scholar] [CrossRef] [Green Version] - Kiprijanovska, I.; Stankoski, S.; Ilievski, I.; Jovanovski, S.; Gams, M.; Gjoreski, H. HousEEC: Day-Ahead Household Electrical Energy Consumption Forecasting Using Deep Learning. Energies
**2020**, 13, 2672. [Google Scholar] [CrossRef] - Zor, K.; Çelik, Ö.; Timur, O.; Teke, A. Short-term building electrical energy consumption forecasting by employing gene expression programming and GMDH networks. Energies
**2020**, 13, 1102. [Google Scholar] [CrossRef] [Green Version] - Li, Z.; Friedrich, D.; Harrison, G.P. Demand Forecasting for a Mixed-Use Building Using Agent-Schedule Information with a Data-Driven Model. Energies
**2020**, 13, 780. [Google Scholar] [CrossRef] [Green Version] - Culaba, A.B.; Del Rosario, A.J.R.; Ubando, A.T.; Chang, J.-S. Machine learning-based energy consumption clustering and forecasting for mixed-use buildings. Int. J. Energy Res.
**2020**, 44, 9659–9673. [Google Scholar] [CrossRef] - Wang, Z.; Wang, Y.; Zeng, R.; Srinivasan, R.S.; Ahrentzen, S. Random Forest based hourly building energy prediction. Energy Build.
**2018**, 171, 11–25. [Google Scholar] [CrossRef] - Sauer, J.; Mariani, V.C.; dos Santos Coelho, L.; Ribeiro, M.H.D.M.; Rampazzo, M. Extreme gradient boosting model based on improved Jaya optimizer applied to forecasting energy consumption in residential buildings. Evol. Syst.
**2021**, 1–12. [Google Scholar] [CrossRef] - Bassi, A.; Shenoy, A.; Sharma, A.; Sigurdson, H.; Glossop, C.; Chan, J.H. Building energy consumption forecasting: A comparison of gradient boosting models. In Proceedings of the 12th International Conference on Advances in Information Technology, Bangkok, Thailand, 29 June–1 July 2021. [Google Scholar] [CrossRef]
- Mariano-Hernández, D.; Hernández-Callejo, L.; Solís, M.; Zorita-Lamadrid, A.; Duque-Perez, O.; Gonzalez-Morales, L.; Santos-García, F. A Data-Driven Forecasting Strategy to Predict Continuous Hourly Energy Demand in Smart Buildings. Appl. Sci.
**2021**, 11, 7886. [Google Scholar] [CrossRef] - Olu-Ajayi, R.; Alaka, H.; Sulaimon, I.; Sunmola, F.; Ajayi, S. Building energy consumption prediction for residential buildings using deep learning and other machine learning techniques. J. Build. Eng.
**2022**, 45, 103406. [Google Scholar] [CrossRef] - Lemos, V.H.B.; Almeida, J.D.S.; Paiva, A.C.; Junior, G.B.; Silva, A.C.; Neto, S.M.B.; Lima, A.C.M.; Cipriano, C.L.S.; Fernandes, E.C.; Silva, M.I.A. Temporal convolutional network applied for forecasting individual monthly electric energy consumption. In Proceedings of the 2020 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Toronto, ON, Canada, 11–14 October 2020; pp. 2002–2007. [Google Scholar]
- Bendaoud, N.M.M.; Farah, N. Using deep learning for short-term load forecasting. Neural Comput. Appl.
**2020**, 32, 15029–15041. [Google Scholar] [CrossRef] - Gao, Y.; Ruan, Y.; Fang, C.; Yin, S. Deep learning and transfer learning models of energy consumption forecasting for a building with poor information data. Energy Build.
**2020**, 223, 110156. [Google Scholar] [CrossRef] - Bifet, A.; Gavaldà, R. Learning from time-changing data with adaptive windowing. In Proceedings of the 7th SIAM International Conference on Data Mining, Minneapolis, MN, USA, 26–28 April 2007; pp. 443–448. [Google Scholar]
- Moon, J.; Kim, Y.; Son, M.; Hwang, E. Hybrid Short-Term Load Forecasting Scheme Using Random Forest and Multilayer Perceptron. Energies
**2018**, 11, 3283. [Google Scholar] [CrossRef] [Green Version] - Khosravani, H.; Castilla, M.; Berenguel, M.; Ruano, A.; Ferreira, P. A Comparison of Energy Consumption Prediction Models Based on Neural Networks of a Bioclimatic Building. Energies
**2016**, 9, 57. [Google Scholar] [CrossRef] [Green Version] - Ali, U.; Shamsi, M.H.; Bohacek, M.; Hoare, C.; Purcell, K.; Mangina, E.; O’Donnell, J. A data-driven approach to optimize urban scale energy retrofit decisions for residential buildings. Appl. Energy
**2020**, 267, 114861. [Google Scholar] [CrossRef] - Anđelković, A.S.; Bajatović, D. Integration of weather forecast and artificial intelligence for a short-term city-scale natural gas consumption prediction. J. Clean. Prod.
**2020**, 266, 122096. [Google Scholar] [CrossRef]

**Figure 2.**(

**a**) Basic RF architecture. (

**b**) Basic XGBoost architecture. (

**c**) Basic CNN architecture. (

**d**) Basic TCN architecture.

**Figure 4.**(

**a**) View of Building 1. (

**b**) Hourly electricity consumption for Building 1. (

**c**) View of Building 2. (

**d**) Hourly electricity consumption for Building 2.

**Figure 5.**(

**a**) Performance of forecasting algorithms without DDM by hours in Building 1. (

**b**) Performance of forecasting algorithms without DDM by hours in Building 2. (

**c**) Performance of forecasting algorithms with DDM by hours in Building 1. (

**d**) Performance of forecasting algorithms with DDM by hours in Building 2.

Ref. | Contributions | Limitations |
---|---|---|

[19] | A proposed approach for load forecasting where the model is persistently refreshed as new information shows up. | The tuning module could utilize a more modern approach to following precision patterns. |

[20] | Proposed online ensemble methods for load forecasting under the concept of drift. | The research did not evaluate concept drift or the performance during the drifting duration. |

[21] | Proposed a model that helps to identify anomalies using paired learners. | Delay of a few hours between the anomaly and its detection. |

[22] | Analyzed different drift detection methods for data streams in smart city applications. | Absence of accessible or reusable benchmark datasets in the literature to completely compare the outcomes. |

[23] | Proposed an unsupervised drift detection approach capable of analyzing streaming data in a smart grid. | The approach was not compared with a deep learning algorithm that incorporates drift detection methods. |

[24] | Suggested a drift detection approach based on the analysis of the change caused by new information using extreme learning machines. | Need for an automatic setting of the parameters for the proposed drift detection approach. |

[25] | Implemented a segmentation of time series based on stationarity using drift detection methods. | The approach needs to have previous knowledge about the time series cyclical behaviors. |

[26] | Proposed a passive drift detection approach using Robust Soft and Generalized Learning Vector Quantization. | The proposed method was compared with drift detection algorithms without optimized hyperparameters. |

[27] | Proposed an improvement for the Robust Soft Learning Vector Quantization algorithm to be used in drift detection. | The proposed approach method performs better in synthetic concept drift streams but not in real-world streams. |

[28] | Proposed an approach based on random trees algorithm to deal with changes using drift detection methods. | The proposed approach discards the previous anomaly instead of updating the detection model. |

Algorithms | Hyperparameter |
---|---|

Random Forest | max_depth = 45; n_estimators = 200; min_samples_leaf = 1 |

eXtreme Gradient Boosting | n_estimators = 50; eta = 0.1; max_depth = 5; colsample_bytree = 0.8; subsample = 0.8; gamma = 1 |

Convolutional Neural Network | filters = 64; kernel_size = 2; batch size = 1; activation function = linear; optimizer = adam; learning rate = 0.001; maxpooling1D (pool_size = 2); loss function = mean squared error |

Temporal Convolutional Network | filters = 200; kernel_size = 4; batch size = 1; dilations = [1, 2, 4, 8, 16, 32]; activation function = linear |

RF | XGBOOST | ||||||||
---|---|---|---|---|---|---|---|---|---|

Method | ND | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} |

Wo/DDM | n/a | 9.23 | 16.24 | 29.48 | 0.827 | 8.81 | 15.01 | 27.16 | 0.853 |

ADWIN | 10 | 8.95 | 15.68 | 28.61 | 0.837 | 8.69 | 14.84 | 26.89 | 0.856 |

KSWIN | 111 | 8.53 | 14.98 | 27.78 | 0.846 | 8.56 | 14.63 | 26.62 | 0.859 |

24 H | 365 | 8.46 | 14.83 | 27.59 | 0.848 | 8.51 | 14.57 | 26.59 | 0.859 |

RF | XGBOOST | ||||||||
---|---|---|---|---|---|---|---|---|---|

Method | ND | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} |

Wo/DDM | n/a | 19.47 | 9.08 | 14.95 | 0.861 | 17.78 | 8.17 | 13.97 | 0.878 |

ADWIN | 15 | 17.61 | 8.51 | 14.42 | 0.870 | 16.96 | 7.94 | 13.73 | 0.882 |

KSWIN | 108 | 16.44 | 7.91 | 13.89 | 0.880 | 16.68 | 7.78 | 13.54 | 0.886 |

24H | 365 | 16.14 | 7.83 | 13.87 | 0.880 | 16.55 | 7.77 | 13.57 | 0.885 |

CNN | TCN | ||||||||
---|---|---|---|---|---|---|---|---|---|

Method | ND | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} |

Wo/DDM | n/a | 9.40 | 17.14 | 30.78 | 0.811 | 9.03 | 15.88 | 29.42 | 0.828 |

ADWIN | 10 | 12.51 | 20.74 | 32.21 | 0.793 | 10.89 | 18.9 | 33.28 | 0.780 |

KSWIN | 111 | 12.35 | 20.45 | 31.96 | 0.797 | 10.11 | 17.68 | 32.01 | 0.796 |

24H | 365 | 10.93 | 18.56 | 30.75 | 0.812 | 10.15 | 17.41 | 30.97 | 0.809 |

CNN | TCN | ||||||||
---|---|---|---|---|---|---|---|---|---|

Method | ND | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} | MAPE (%) | MAE (kWh) | RMSE (kWh) | R^{2} |

Wo/DDM | n/a | 16.97 | 9.62 | 17.41 | 0.811 | 17.58 | 8.98 | 15.85 | 0.843 |

ADWIN | 15 | 21.49 | 11.39 | 18.57 | 0.785 | 19.18 | 9.66 | 17.01 | 0.819 |

KSWIN | 108 | 19.67 | 10.18 | 16.95 | 0.821 | 17.38 | 8.93 | 16.24 | 0.835 |

24H | 365 | 18.89 | 10.10 | 17.14 | 0.817 | 18.09 | 9.17 | 16.39 | 0.832 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Mariano-Hernández, D.; Hernández-Callejo, L.; Solís, M.; Zorita-Lamadrid, A.; Duque-Pérez, O.; Gonzalez-Morales, L.; García, F.S.; Jaramillo-Duque, A.; Ospino-Castro, A.; Alonso-Gómez, V.;
et al. Analysis of the Integration of Drift Detection Methods in Learning Algorithms for Electrical Consumption Forecasting in Smart Buildings. *Sustainability* **2022**, *14*, 5857.
https://doi.org/10.3390/su14105857

**AMA Style**

Mariano-Hernández D, Hernández-Callejo L, Solís M, Zorita-Lamadrid A, Duque-Pérez O, Gonzalez-Morales L, García FS, Jaramillo-Duque A, Ospino-Castro A, Alonso-Gómez V,
et al. Analysis of the Integration of Drift Detection Methods in Learning Algorithms for Electrical Consumption Forecasting in Smart Buildings. *Sustainability*. 2022; 14(10):5857.
https://doi.org/10.3390/su14105857

**Chicago/Turabian Style**

Mariano-Hernández, Deyslen, Luis Hernández-Callejo, Martín Solís, Angel Zorita-Lamadrid, Oscar Duque-Pérez, Luis Gonzalez-Morales, Felix Santos García, Alvaro Jaramillo-Duque, Adalberto Ospino-Castro, Victor Alonso-Gómez,
and et al. 2022. "Analysis of the Integration of Drift Detection Methods in Learning Algorithms for Electrical Consumption Forecasting in Smart Buildings" *Sustainability* 14, no. 10: 5857.
https://doi.org/10.3390/su14105857