# A Data-Driven Forecasting Strategy to Predict Continuous Hourly Energy Demand in Smart Buildings
## 4 Results and Discussion  
After evaluating the aforementioned models with the accuracy metrics, the results shown in Table 2 were obtained. Using the MAPE as a reference, it is observed that in building 1 the models that gave the best results were XGBoost, and TCN while in building 2 were CNN and TCN. To improve the results obtained by the models with the proposed strategy, different tests were carried out. The tests consisted of combining the different models to obtain an assembled model (meanBest). The best combination was selected based on the lowest MAPE (see Table 3), which in this case was C5 for building 1 and C4 for building 2. To validate that there is a significant difference between the models from the statistical point of view, an analysis of variance (ANOVA) for repeated measures and post hoc multiple pairwise comparisons between groups with Bonferroni correction, taken the MAPE as a measure of analysis was used between the best four simple models and the best-assembled model for each of the buildings; see Table 4 for building 1 and Table 5 for building 2. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Building 1**} & \multicolumn{4}{c}{**Building 2**} \\ \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**R2**} & **RMSE** & **MAE** & **MAPE** & \multirow{2}{*}{**R2**} & **RMSE** & **MAE** & **MAPE** \\  & & **(kWh)** & **(kWh)** & **(\%)** & & & **kWh)** & **(kWh)** & **(\%)** \\ \hline MLR & 0.72 & 37.34 & 26.19 & 16.79 & 0.72 & 21.01 & 15.27 & 38.31 \\ ANN & 0.75 & 35.48 & 22.56 & 13.26 & 0.79 & 18.19 & 12.22 & 26.84 \\ RF & 0.83 & 29.45 & 16.2 & 9.22 & 0.86 & 15.16 & 9.15 & 19.68 \\ XGBoost & 0.85 & 27.23 & **15** & **8.83** & 0.87 & 14.12 & 8.22 & 17.92 \\ LSTM & 0.79 & 32.26 & 17.74 & 10.18 & 0.83 & 16.38 & 9.33 & 19.36 \\ CNN & 0.81 & 30.71 & 17.07 & 9.38 & 0.81 & 17.35 & 9.59 & 16.96 \\ TCN & 0.83 & 29.43 & **15.84** & **9.02** & 0.84 & 16.04 & 9.01 & 17.74 \\ TFT & 0.69 & 39.57 & 17.7 & 9.22 & 0.84 & 16.08 & 9.53 & 18.84 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Performance of each model by building. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{4}{c}{**Building 1**} & \multicolumn{4}{c}{**Building 2**} \\ \hline \multirow{2}{*}{**Assembled**} & \multirow{2}{*}{**R2**} & **RMSE** & **MAE** & **MAPE** & \multirow{2}{*}{**R2**} & **RMSE** & **MAE** & **MAPE** \\  & & **(kWh)** & **(kWh)** & **(\%)** & & & **(kWh)** & **(kWh)** & **(\%)** \\ \hline C2 & 0.86 & 26.70 & 14.40 & 8.31 & 0.86 & 14.78 & 8.25 & 15.66 \\ C3 & 0.86 & 26.73 & 14.43 & 8.27 & 0.88 & 13.81 & 7.69 & 15.44 \\
**C4** & 0.86 & 26.76 &  
The results of the ANOVA indicated that at least one MAPE is different, so multiple comparisons must be made to determine between which there are differences. According to Tables 4 and 5, it can be mentioned that the MAPE of the meanBest is statistically different from the other models for both buildings. However, when directly evaluating the RF and TF models, as well as the TCN and TF models, the test indicates that there is no significant difference between them for the case of building 1. The same case happens for the XGBoost and TCN models in building 2. Figure 6 shows the behavior of both buildings concerning the days of the week, months of the year, and weeks of the year. When performing an analysis of the behavior of the models per day, it can be seen in a general way that the models maintain the same trend except for linear regression (LR) and neural network (NN). For LR, it is because it models linear relationships, which is clearly at a disadvantage before the other models that can capture non-linear relationships, while for the NN, it could not capture the non-linear relationships on specific days of the week.