## 2 Materials and Methods
The use of several data sources also helps to diversify the weather data, combining satellite and weather station data. From these sources, data on hourly values of temperature, relative humidity, cloudiness and wind speed were obtained. Retrospective data on hourly solar radiation energy flux densities were obtained from measurements from a local weather station. The solar declination angle was calculated based on the mathematical calculation described below [53]. \[\delta=23.45\cdot\sin\left(360\cdot\frac{284+n}{365}\right), \tag{5}\]  
where \(n\) is the number of the day in the year. As a result, a dataset was created containing 9 features and one target variable--generation. The list of parameters included in the source data are presented in Figure 1:0  
Meteorological data from three sources were averaged and reduced to a one-hour resolution to obtain the most stable and reliable parameters. Meteorological data were collected for a period of one year according to the power generation data time period. In addition, the original dataset was cleared of outliers and omissions in the data. There are descriptions of several functions used in the pseudo code listed below (Algorithm 1): \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Source** & **Parameter** & **Source** \\ \hline Date & Yandex, NasaPower, WeatherUnderground & Cloudiness & Yandex, NasaPower, WeatherUnderground \\ \hline Time & Yandex, NasaPower, WeatherUnderground & Temperature & Yandex, NasaPower, WeatherUnderground \\ \hline Day number of the year & Location of the station & Humidity & Yandex, NasaPower, WeatherUnderground \\ \hline Solar declination angle & Calculation & Wind speed & Yandex, NasaPower, WeatherUnderground \\ \hline Local time & Yandex, NasaPower, WeatherUnderground & Generation, fact & Commercial electricity metering data \\ \hline \hline \end{tabular}
\end{table} 
Table 1: A list of parameters included in the source data. drop_empty_strings (0)--deletes data samples if there is one or more empty or non-numerical values;
* delete_outliers (0)--deletes data samples if outliers are detected using boxplot and quartile distribution in any of the data features;
* min_max_norm (0)--rescales feature values to the range between 0 and 1;
* regr_data_P, W\({}_{1}\).parameters, etc.--selects particular features (column in the database) to store on received values. ```
Input:P,W\({}_{1}\),W\({}_{2}\),W\({}_{3}\) Output:regr_data, cluster_data Auxiliary variables: counter, sum, Initialization: counter = 0, sum = 0 Begin Data Preprocessing Algorithm
1 for(p = 1, \(\ldots\), n)do
2 sum = sum + P[p]
3 count = count + 1 if count == 2 do
5 regr_data_P = sum/count
6 count, sum = 0
7 endif
8 endfor
9 for data in regr_data, W\({}_{1}\), W\({}_{2}\), W\({}_{3}\)do
10 data = drop_empty_strings(data)
11 data = delete_outliers(data)
12 endfor
13 for h in regr_data_hour do
14 if h in W\({}_{1}\).hour do
15 x\({}_{1}\) = W\({}_{1}\).parameters
16 else
17 x\({}_{1}\) = 0
18 endif
19 if h in W\({}_{2}\).hour do
20 x\({}_{2}\) = W\({}_{2}\).parameters
21 else
22 x\({}_{2}\) = 0
23 endif
24 if h in W\({}_{3}\).hour do
25 x\({}_{3}\) = W\({}_{3}\).parameters
26 else
27 x\({}_{3}\) = 0
28 endif
29 regr_data_parameters = (x\({}_{1}\) + x\({}_{2}\) + x\({}_{3}\))/3
30 endfor
31 cluster_data = [regr_data_Temperature, regr_data_Humidity, regr_data_Wind_speed]
32 for x in cluster_data_parameters do
33 x = x.min_max_norm(x)
34 endfor
35 return regr_data, cluster_data End Data Preprocessing Algorithm
```  
**Algorithm 1** Pseudo Code for Data Preprocessing  
As a result of the data preprocessing described above, the dimension of the dataset decreased from 11,928 rows to 11,245 rows (6% of the original data volume).