## 4 Data-Driven Framework for Building Energy Consumption Prediction
### Evaluation Metrics  
The evaluation metrics of predictive models serve as indispensable quantitative tools for assessing their performance and effectiveness. By precisely measuring the model's performance on a test set, they provide researchers with clear benchmarks for evaluating the merits of different models [176]. Among the numerous evaluation metrics, mean absolute error (MAE), MAPE, mean square error (MSE), RMSE, and R\({}^{2}\) score are frequently used [177]. \[MAE=\frac{1}{n}\sum_{i=1}^{n}|x_{i}-y_{i}| \tag{6}\]\[MAPE=\frac{100\%}{n}\sum_{i=1}^{n}\left|\frac{y_{i}-x_{i}}{y_{i}}\right| \tag{7}\]  
\[MSE=\frac{1}{n}\sum_{i=1}^{n}(x_{i}-y_{i})^{2} \tag{8}\]  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}(y_{i}-x_{i})^{2}}{n}} \tag{9}\]  
\[R^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}-x_{i})^{2}}{\sum_{i=1}^{n}(y_{i}-\overline{y })^{2}} \tag{10}\]  
where \(n\) represents the number of samples; \(x_{i}\) denotes the \(i\)-th simulated value; \(y_{i}\) indicates the \(i\)-th actual measurement; \(\overline{x}\) represents the mean of the simulated values; and \(\overline{y}\) signifies the mean of the actual measurements. In building energy consumption prediction, different algorithms are closely related to these evaluation metrics. Take the linear regression algorithm as an example. It attempts to find the best-fitting straight line to describe the relationship between energy consumption data and related variables. In this case, the MAE can intuitively reflect the average degree of deviation between the predicted values of linear regression and the actual building energy consumption values. Since linear regression is sensitive to the overall trend of the data, the MAE can robustly measure its prediction error. Even if there are a few abnormal energy consumption data points, they will not overly interfere with the judgment of the overall error of the model. However, when linear regression encounters complex non-linear relationships in the data, the MAE may not be able to comprehensively reflect the differences in the prediction performance of the model in different regions. At this time, combining it with the MSE or RMSE can further analyze the situation. The decision tree algorithm classifies or predicts building energy consumption by constructing a tree structure. The MAPE is of great significance for the evaluation of the decision tree algorithm. Because when the decision tree processes different categories of data, the MAPE can intuitively display the relative prediction error in the form of a percentage, helping researchers understand the accuracy of the decision tree's prediction within different energy consumption level intervals. However, the decision tree may change greatly due to slight fluctuations in the data when dividing nodes. If there are outliers in the data, the MAPE will be significantly increased, leading to a deviation in the evaluation of the overall performance of the model. The neural network algorithm is widely used in building energy consumption predictions, and its complex structure enables it to learn complex patterns in the data. When evaluating a neural network model, the MSE, due to its amplifying effect on larger errors, can prompt the neural network to pay more attention to those energy consumption data points with larger prediction deviations during the training process. Through the back-propagation algorithm, the network parameters are continuously adjusted to improve the overall prediction accuracy. As the square root of the MSE, the RMSE provides a more intuitive interpretation of the prediction results of the neural network model. Researchers can quickly determine the degree of closeness between the predicted values of the neural network model and the actual building energy consumption values through the RMSE and then evaluate the performance of the model. The R\({}^{2}\) value is universal in the evaluation of various algorithms.