# Prediction of Wind Power with Machine Learning Models
## 2 Materials and Methods
### Obtaining Parameters and Pre-Processing  
Two types of input data sets, internal and external, were used to estimate wind power. External inputs for ML algorithms must be carefully selected to estimate wind power. In this context, the environmental conditions in which the wind turbine is located should be considered, and the effect of the wind turbine on the active power output should be carefully evaluated. In this study, two independent data sets were combined and used to predict the wind power correctly. The first data set contained internal values, such as theoretical power (kW) and active power (kW) of the wind turbine. The second data set comprised external values containing the meteorological data set, which can affect the wind power forecast. Wind power was determined as the dependent output data. The internal data set contained information taken from the Esenkoy wind power plant shown in Figure 1 in the northwest part of Turkey (coordinate information \"X: 40.58545 Y: 28.99035\"), and this information was taken from a freely accessible wind turbine SCADA database [28]. The turbine used in the power plant was the N117/3600 model turbine produced by the Nordex company. Within the SCADA system, data such as wind speed (m/s), wind direction (\({}^{\circ}\)), theoretical power (kW), and active power (kW) belonging to the wind turbine for one year (1 January-31 December 2018) were periodically recorded. The external data set, calculated using the latitude and longitude coordinates of the wind turbine, consisted of meteorological parameters provided by MERRA-2 Global (Modern Era Retrospective Analysis for Research and Applications) [29] and belonged to a specific date range (1 January-31 December 2018). In this data set, information regarding the turbine's location is recorded hourly, including temperature (\({}^{\circ}\)C), precipitation amount (mm/hour), air density (kg/m\({}^{3}\)), solar radiation at ground level (W/m\({}^{2}\)), solar radiation above the atmosphere (W/m\({}^{2}\)), and cloud cover ratio. To achieve the most accurate results for predicting active power, merging two data sets within the same time interval was necessary. The first data set comprised 50,530 samples, among which 2030 missing data instances were identified. Therefore, the missing data were successfully imputed using the kNN algorithm, an ML technique employed for effectively completing missing data instances [31]. Subsequently, a new data set was created by filtering only the hourly data. Finally, the new data set was merged with the second data set, resulting in a final data set comprising 8760 observations. It is crucial to determine and quantify the strength of the impacts of the features in the data set on the generation of active wind power compared to other sources. Given the influence of multiple factors on power production, it is imperative to comprehend the interrelationships among these factors. To this end, a correlation matrix can be utilised to evaluate the correlations between the various elements. As illustrated in Figure 2, a visual depiction of the correlation coefficients between all input features and active power is provided. This graph expresses the correlation between one parameter and another numerically, ranging from \(-1\) to \(+1\). This correlation matrix shows how these independent input variables and the dependent output value affect each other. Upon analysing the correlation matrix presented in Figure 2, it becomes evident that the most significant influences on active power are attributed to the theoretical power curve and wind speed. Conversely, dynamic control negatively correlates with wind direction, temperature, and radiation rates. The temperature rise reduces air density, consequently negatively impacting wind power generation. Furthermore, heightened solar radiation elevates temperature levels, indirectly contributing to declining wind power potential. On the other hand, parameters such as air density, cloud cover ratio, and precipitation demonstrate a positive influence.