## 2 Materials and Methods  
The proposed algorithm includes \(11\) stages and can be presented as the flow chart in Figure 1.  
The data preparation stages (Figure 2) were conducted according to the list below:  
* Data collection from different sources;
* Sorting and merging collected data;
* Removing night observations, outliers, and highly correlated features. Figure 1: Flow chart of the proposed algorithm. To perform the clustering, four algorithms were tested (KMeans, Agglomerative clustering, Spectral clustering and GaussianMixture) [47]. The distance between data points was calculated using the Euclidean metric:  
\[d_{2}(x_{i},x_{j})=\sum_{k=1}^{d}\left(x_{i,k}-x_{j,k}\right)^{2}\right)^{1/2}= \left\|x_{i}-x_{j}\right\|_{2} \tag{1}\]  
To compare the clustering results of different models, the following metrics were used:  
* Silhouette coefficient (silhouette);
* Between-cluster sum of squares (BSS);
* Within-cluster sum of squares (WSS). The motive of using all three metrics to evaluate the clustering performance is that, when we use only one of the metrics, we could obtain good numerical values from that metric which correspond to the non-satisfactory results. For example, if we use only the silhouette coefficient, it could be maximized numerically (reaching a value of 1.0), but, at the same time, our cluster borders may become extra complex (may have a weight shape). On the other hand, if we use either the WSS or BSS metric, it could result in a great amount of very small-sized clusters in one case or 1-2 large-sized clusters in another case. The above metrics were calculated using the following formulas [48]:  
\[Silhouette=\sum_{k_{1}}\sum_{x_{i}\in c_{k_{1}}}\frac{b-a}{\max(b,a)}, \tag{2}\] \[a=\frac{1}{\left|c_{k}\right|}\sum_{x_{j}\in c_{k}}\left\|x_{i}- x_{j}\right\|\quad x_{i}\in c_{k},\] \[b=\min\left(\frac{1}{\left|c_{l}\right|}\sum_{x_{j}\in c_{l}} \left\|x_{i}-x_{j}\right\|\right)\quad x_{i}\
otin c_{l},\]  
where \(a\) is the average distance between objects within one cluster; \(b\) is the minimum average distance between an object in one cluster and other clusters; \(c_{k}\), \(c_{l}\) are the clusters; \(x_{i}\), \(x_{j}\) are objects inside the clusters. The separability of clusters is characterized by the parameter BSS [49] or intercluster distance and is calculated for one cluster as follows:  
\[BSS=\sum_{k=1}^{M}\left(\overline{x_{k}}-\overline{x_{j}}\right)^{2},\quad \overline{x_{j}}\
otin c_{k}, \tag{3}\]  
where \(M\) is the number of clusters; \(c_{k}\) is the cluster; and \(x_{k}\), \(x_{j}\) are the objects inside clusters. Figure 2: Data preprocessing stages. Compactness is characterized by the WSS parameter [49] or intra-cluster distance and is calculated for one cluster as follows:  
\[WSS=\sum_{i=1}^{|c_{k}|}(x_{i}-\overline{x_{j}})^{2},\ \ \ \overline{x_{j}}\in c_{k},\ j \
eq i, \tag{4}\]  
where \(c_{k}\) is the cluster and \(x_{i},x_{j}\) are the objects inside clusters. The silhouette coefficient ranges from \(-1\) to \(+1\), and the closer it is to \(+1\), the more correct the data separation is considered. The BSS and WSS metrics ranges are not limited and depend on the considered task and data structure. To build and train a model for predicting the generation and operating modes of a photovoltaic plant, a dataset was collected. It consists of meteorological and geometric parameters of the movement of the Sun, necessary for the physical explanation of the process of propagation of solar radiation. Also, the actual data on the generation of the solar power plant located at the 46 th latitude in the Caspian region were used. Several weather providers were used as sources for obtaining retrospective meteorological data:  
* [noitemsep,nolistsep]
* Yandex (Russia) [50];
* WeatherUnderground (United States) [51];
* NasaPower (United States) [52]. It is important to use several weather data sources to minimize errors related to biased data, which may occur if the weather stations are located far away from the considered location.