## 2 Materials and Methods
### Methods  
In this empirical study, six distinct machine learning methods--namely, linear regression, Ridge regression, Lasso regression, ElasticNet regression, Support Vector Regression, and Random Forest--were utilized to predict six months' (January-June) energy production data of 100-watt monocrystalline and polycrystalline photovoltaic (PV) panels under environmental impacts. This study applied machine learning algorithms to model the relationship between energy production and environmental parameters. The dependent variable (target) was defined as energy production, while the independent variables (features) were irradiance, air temperature, panel temperature, humidity, atmospheric pressure, wind speed, and ultraviolet index. The dataset was created from the data recorded every hour between 8:00 am and 17:00 pm and optimized to perform meaningful analyses. In this context, the most significant 10 to 15 data points of each day were selected using Python programming language and powerful data filtering and processing libraries. This optimized dataset formed the basis of mathematical models analyzing the relationship between energy production and environmental variables:  
\[y=f( irradiance,temperature,panel temperature,humidity,pressure,wind speed,UV index)\]  
In this context, the variable y denotes the energy production, whilst the variable f is contingent on the machine learning algorithm employed. This approach yielded a comprehensive evaluation of the impact of environmental factors on energy production and facilitated the identification of the most suitable model for predicting the performance of PV panels under diverse environmental conditions. The comparative results are presented in Section 3. The analysis of these disparate machine learning regression models yielded the determination of Mean Absolute Error (MAE), Mean Squared Error (MSE), and R-squared coefficient (R\({}^{2}\)) values, which in turn facilitated the production prediction in PV panels, with the results presented in order of descending merit. Similar regression-based approaches have been employed in studies predicting material properties and energy outputs under varying environmental and operational conditions, demonstrating the versatility and accuracy of these methods [17; 18]. The linear regression model is based on the assumption of a linear relationship between the estimated energy production and the observed data. Ridge regression represents a variant of linear regression, whereby a penalty term is introduced to prevent overfitting. The principal objective is to guarantee that the model avoids overfitting. Lasso regression is a further variant of linear regression. In contrast to the aforementioned method, it attempts to make a prediction by reducing the less important features of the model to zero. ElasticNet represents a combination of Ridge and Lasso regressions, with the objective of achieving enhanced prediction outcomes by leveraging the strengths of both methodologies. The fundamental approach to modeling the relationship between independent (\(X\)) and dependent variables (\(y\)) is that of linear regression. The fundamental assumption of linear regression is that the relationship between the independent and dependent variables can be expressed as a straight line. \[y=\beta_{0}+\beta_{1}X_{1}+\beta_{2}X_{2}+\ldots+\beta_{n}X_{n}+\epsilon\]  
In this model, the dependent variable (\(y\)) is regressed on the intercept (\(\beta_{0}\)), and the coefficients (\(\beta_{i}\)) for each independent variable. The independent variables (\(X_{1}\)) are also included in the model, along with an error term (\(\epsilon\)) [19]. The issue of overfitting can be addressed by the introduction of an \(L2\) penalty term to the loss function, as is performed in Ridge regression.