# The Integration of Internet of Things and Machine Learning for Energy Prediction of Wind Turbines
## 3 ML for Wind Energy Prediction
### Dataset and Preprocessing
* NumPy is an essential library for scientific computation in Python, commonly referred to as \"Numerical Python\". The software provides support for large, complex arrays and matrices, together with a collection of mathematical algorithms to effectively handle these arrays. * Matplotlib is a flexible toolbox that enables the generation of static, interactive, and animated visualizations in the Python computer language. The pyplot module offers a MATLAB-like interface for producing plots and visualizations, simplifying the process of generating charts, histograms, scatter plots, and other graphical representations. * Seaborn is a data visualization package that enhances the capabilities of matplotlib and provides a more sophisticated interface for creating visually appealing and meaningful statistical graphics. It streamlines the procedure of generating intricate visualizations  
Figure 9: Gaussian distribution including outliers. and provides pre-installed themes and color palettes to increase the visual appeal of plots. Dataset: There are four data frames, namely loc1, loc2, loc3, and loc4, that are all of equal size. All data in the datasets originate from the utilization of IoT devices to measure meteorological conditions with consistent precision. The number of rows in each data frame is 43,800, and the number of columns is 10. This study centers on the examination carried out utilizing the loc1 dataset. The columns consist of the following variables: time, temperature, relative humidity, dewpoint, wind direction, wind speed, and wind gusts at 2, 10, and 100 m, as shown in the first five rows of Figure 10. There are six variables of float64 data type, three variables of int64 data type, and one variable of object data type. Since time is an object, it will be transformed to datetime before being used for analysis. The conversion is performed using the function (pd.to_datetime) from the Pandas package [22]. The subsequent tables and figures originate from the exploratory data analysis conducted at loc1. Based on the corresponding time values, in Table 1, organize the power-generating data into separate columns for year, month, and day. Null values: A non-null value refers to any numerical, textual, or other type of value that is not null [23]. The data frame has 43,800 non-null values in each column, corresponding to the index range of 0-43,799. By utilizing Python's function.null().sum(), can determine the number of null values for each variable. Datasets do not contain any null values as described in Table 2. Determining influential and anomalous data points is essential as it will aid in future data collection and the proper utilization of existing knowledge. \begin{table}
\begin{tabular}{l l} \hline
**Columns** & **Null Values** \\ \hline Time & 43,800 non-null datetime64 \\ temperature\_2m & 43,800 non-null float64 \\ relativehumidity\_2m & 43,800 non-null int64 \\ dewpoint\_2m & 43,800 non-null float64 \\ windspeed\_10m & 43,800 non-null float64 \\ windspeed\_100m & 43,800 non-null float64 \\ winddirection\_10m & 43,800 non-null int64 \\ winddirection\_100m & 43,800 non-null int64 \\ windgusts\_10m & 43,800 non-null float64 \\ Power & 43,800 non-null float64 \\ Year & 43,800 non-null int32 \\ Month & 43,800 non-null int32 \\ Day & 43,800 non-null object \\ \hline \end{tabular}
\end{table} 
Table 1: Data columns from location 1. Figure 10: The first 5 rows in dataset of location1. The distribution of wind gusts in Figure 12 may show significant skewness due to extreme values, which can obscure the true underlying patterns. After outlier removal, the distribution typically becomes more normal, allowing for clearer insights and more accurate analyses. Correlation: The dataset is currently accessible and prepared for utilization in deriving significant insights. Correlation study between measurements such as temperature, relative humidity, and wind speed will assist in selecting parameters for prediction [24]. These highly correlated metrics aid in predicting the power generated by wind turbines.