# Energy Analysis in Green Building via Machine Learning: A Case Study in a Hospital
## 3 Results and Discussion  
First, in order to determine which parameter will be used in the estimation process, a prediction study was carried out with the vanilla LSTM, which is the basic LSTM method, using four parameters that are important in building energy analysis. These four parameters are total power factor, power factor, Total Harmonic Distortion Voltage, and Total Harmonic Distortion Current. Accordingly, the prediction results can be seen in Figure 1.  
Figure 1: Results for TPF, PF, THDV, and THDC. The error rate, which measures the quality of the difference between actual values and predicted values, was calculated. As a result, calculations were made using the MAE, MSE, and RMSE error rate methods, which examine the relationship between the prediction results and real data. These error rates are presented in Table 2.  
In the results obtained, it was observed that the lowest error rate was in the total power factor. Therefore, it was decided to use this parameter in the remaining part and compare the effect of different LSTM methods on TPF estimation. In the simulations made in this study, some operations were performed to see the advantages of the LSTM method. TPF value is marked as a prediction output. The other 102 variables were marked as an input data set. Specific parts of the data set can be seen in Table 3.  
A training study was conducted using the LSTM model using the data set given in Table 3. As a result of the training, the predicted values and actual values were examined comparatively. A summary of these results can be seen in Table 4.  
In this study, a prediction study was carried out on the data set with five different types of LSTM. These LSTM types are vanilla LSTM, stacked LSTM, bidirectional LSTM, CNN-LSTM, and encoder-decoder LSTM. As can be seen, the differences between the actual values and the predicted values resulting from these LSTM models are extremely low. \begin{table}
\begin{tabular}{c c c c c c} \hline
**Error Rate** & **TPF** & **PF** & **THDV** & **THDC** \\ \hline MAE & 0.00049273 & 0.00407066 & 0.01423912 & 0.06381466 \\ \hline MSE & 0.00000045 & 0.00003065 & 0.00057725 & 0.01767848 \\ \hline RMSE & 0.00067232 & 0.00553694 & 0.02402605 & 0.13296045 \\ \hline \end{tabular}
\end{table} 
Table 2: MAE, MSE, and RMSE error rates for different parameters. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline
**Time** & **Fundamental** & **Fundamental** & **Fundamental** & **Fundamental** & **Voltage L2** & **Voltage L3** & **Voltage L3** & **Voltage L3** \\  & **Current L1** & **Current L2** & **Current L3** & **Voltage L1 N** & **L3** & **N** & **L1** & **N** \\ \hline \(14/03/2023\) & & & & & & & & & \\
00:00:00 & & & & & & & & & \\
14/03/2023 & & & & & & & & & \\
00:00:00 &  
In Table 4, the TPF value was estimated using five different types of LSTM. Some of these estimates and actual values are exhibited. The error rate, which measures the quality of the difference between actual values and predicted values, was calculated. As a result, calculations were made using the MAE, MSE, and RMSE error rate methods, which examine the relationship between the prediction results obtained as a result of each LSTM method and the real data. Data, including error rates, are presented in Table 5.  
According to these outputs, vanilla LSTM stands out with its lower error rate compared to other methods. The low error rate of this method has also been seen in all three error rate calculation methods. So, it can be said that the vanilla LSTM, one of the methods used in this study, stands out as the best LSTM method for this type of data set. While the MAE error rate in the vanilla LSTM method was measured as 0.00049273, it was observed that the error rate was slightly higher in other prediction methods. These error rates can be seen graphically in Figure 2.  
It can be seen from these error rates that the most efficient method to be used for energy analysis in the building subject to our study is vanilla LSTM.