## 4 Discussion and Conclusions  
This study aimed to evaluate the effectiveness of various tree-based EL models in predicting photovoltaic (PV) energy production by analyzing the effects of environmental factors such as temperature, pressure, and humidity. The results revealed that bagged trees and boosted trees models exhibit favorable prediction results on complex datasets, which highlight the advantages of using advanced tree-based algorithms for similar use cases. The bagged trees model was shown to be the most effective model, producing an _RMSE_ of 1.7152 and an \(R^{2}\) value of 0.5650. These metrics showed that the model effectively reduced dataset noise and minimized overfitting, thus increasing the reliability of the predictions. Regarding the learning results, bagged tree and boosted tree models achieved the best performances among tree-based models with a minimum of eight leaves. Bagged tree trained each decision tree on many different subsamples taken from the dataset and combined the results of all the trees to produce a new tree. This tree was tried to produce predictions as the final tree. At this point, it has been seen that the bagged tree produces successful results and exhibits superior performance than other tree structures. The working principle has shown that it produces better results than other tree structures. The fine tree model showed the weakest performance with an _RMSE_ value of 1.9696 and an \(R^{2}\) value of 0.4264. This highlights the limitations of simpler decision tree models when faced with complex datasets, suggesting that they may not be equipped to capture the complex relationships found in PV energy production. Our findings are consistent with previous literature suggesting that EL approaches such as bagged and boosted trees tend to outperform individual decision trees. Figure 5 visually presents the validation, testing, and response results of the fine tree, medium tree, coarse tree, bagged tree, and boosted tree. As shown in Table 4, extracted through a systematic review of the literature, the superiority of these models reinforces the idea that more sophisticated algorithms are required to accurately predict energy production under changing environmental conditions. However, it is important to acknowledge that training these EL models requires significant computational resources and time. When we look at the _MAE_ validation and _MAE_ test results, the fact that the difference between these two values is very small indicates that there is no overfitting and that the data and models work correctly. Researchers working on this topic should consider the size and complexity of the datasets when selecting appropriate models for real-world applications. Despite significant advances in tree-based, random tree, and random forest algorithms, the current body of research focuses primarily on survey studies rather than practical applications in the energy sector. In addition, although tree-based algorithms are widely used in healthcare, especially in disease identification through image processing, their application in processing real-time data for energy prediction remains limited. This study addresses this gap by providing a comparative analysis of different methods, thus providing valuable insights into the existing literature. Figure 7: Box plot showing the distribution of errors between different models. The findings show that solar energy forecasting models have the potential to significantly increase the accuracy of production estimates. The effects of temperature, pressure, and humidity on energy production are presented in Figure 6. It shows how the temperature, pressure, and humidity data produced results during the training and testing period. The figures showing a comparative result provide suggestive indicators. The models developed in our study could apply to effective management and strategic planning of renewable energy resources.