# Machine Learning and Bagging to Predict Midterm Electricity Consumption in Saudi Arabia
## 5 Discussion  
This section discusses the obtained results and presents a comparison between the performance of electricity consumption prediction in this work with the electricity consumption prediction in similar work in the literature. Although the bagging ensemble using the K* model did improve on the results obtained by the standalone model, these improvements were not major. The bagging K* model improved on the CC, MAPE, RMSPE, MAE, and RMSE by 0.11%, 3.7%, 5.38%, 1.25%, and 0.82%, respectively. Both initial results from the standalone model and the best results gained from the bagging ensemble can effectively predict the next month's electricity consumption. Figure 3 shows the actual consumption values vs. the predicted consumption values in Kilowatts by the proposed model. Since the same dataset used in this study was also used in [30], the work conducted in this study using the K* algorithm is compared with the work of electricity consumption prediction using the ANN in [30]. Thus, this section shows the comparison between the performance of electricity consumption prediction in this work with the electricity consumption prediction in [30]. Table 7 provides the results of the standalone ANN in [30] and standalone K* models in this study after they were performed on the training dataset and testing dataset. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **CC** & **MAPE** & **RMSPE** & **MAE** & **RMSE** \\ \hline Bagging with K* & 0.9383 & 0.1511 & 0.5333 & 0.0158 & 0.0484 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Electricity consumption prediction using the K* algorithm with bagging ensemble. Figure 3: Actual vs. predicted monthly mean Kilowatt values using the proposed model. From Table 7, the results in [30] showed that the CC for the ANN reduced by 8% when the models were evaluated using the testing dataset. Also, MAE was increased by 204% from the training model. As for MAPE, RMSE, and RMSPE, all increased by 72.4%, 224%, and 41%, respectively. As for the performance of the K* model, after evaluating the model on the testing dataset, it was found that the value for CC was decreased by 4.1% compared to the results on the training dataset. Moreover, for MAE, there was a 35.5% increase compared with the results on the training dataset. RMSE also increased by 95.2%. MAPE showed a decrease of 5.9%, and RMSPE increased by 28.2%. When comparing the two models in terms of how well they generalize to new data, it is evident that the K* algorithm surpasses the ANN. This can be seen in the difference of the values for CC, RMSPE, RMSE, and MAE. Moreover, K* had the best MAPE when performed on unseen data. When comparing the results of the ANN with the K* model regarding how differently they perform on the training and testing sets, it can be seen that the results vary. For example, the CC value of the ANN on the training set was the best overall; however, it was also the worst overall after performing it on the unseen data, whereas the K* model's CC exhibited the best performance on the testing set. The CC difference between the ANN and K* on the training set was 0.37%, whereas the difference between K* and the ANN on the testing set was 3.73% in favor of the K* model. As for the MAPE, K* outperformed the ANN in both situations with a 38.1% and 64.5% difference in the training and testing sets, respectively. Similarly, K* also outperformed the ANN through having a better RMSPE of 20.8% for the training dataset and 17.1% for the test set. When comparing the MAE of the training set of both models, it can be seen that their values are almost identical. However, K* performs 54.6% better on the unseen data. Similarly, the values of the RMSE for the training set of both models are almost identical, with a 10% difference in favor of the ANN. Nonetheless, K* produces a better RMSE when performed on the unseen data in the test set with a 34.3% improvement when compared with the ANN.