###### Abstract
Models based on artificial intelligence are built on the use of mathematical algorithms to analyze large volumes of data, identify the influence of these data on the predicted value, highlight the most significant ones and use them to calculate the forecast [30; 31; 32]. Hybrid models, in turn, combine the mechanisms of statistical models, physical approaches to forecasting and artificial intelligence methods. A new area of machine learning research for RES forecasting is the development of explainable AI models [33]. The choice of a forecast model is based on the changing nature of the predicted variable and the available data that can be used to make the forecast. One of the obvious parameters influencing the quality of the forecast and the choice of the forecast model is the forecast horizon [34; 35; 36]. The forecast horizon determines the future time interval for which the forecast is calculated. There is no generally accepted classification of forecast horizons. In most cases, three categories are distinguished: short-term, medium-term and long-term forecasts [37; 38]. Sometimes a fourth category is introduced--ultra-short-term forecasts [39]. The choice of planning horizon influences the choice of an appropriate model and its accuracy. For long-term forecasting, and in cases where narrow localization of the forecast is not required, it is appropriate to use numerical weather prediction models (if the necessary computing power is available). For short-term forecasts, statistical models, artificial intelligence-based models, and combination models are more suitable [40; 41]. PV generation is unstable and sensitive to the weather changes. However, the forecast of the PV generation is crucial for the power system operation and control tasks, and its results should be accurate regardless of weather conditions. Thus, improvements could be provided to this area. This is why the hybrid model, based on clustering of the data using weather features to separate unique weather conditions, can improve the forecasting accuracy. One model (without clustering) has higher chances of overfitting the data because of model complexity. The clustering stage helps to make individual models less complex but more accurately fitted to the data. In this work, clustering was chosen as the most suitable method to test the hypothesis on the improvement of PV power plant forecasting accuracy. As clustering is one of the forms of data abstraction, we needed to select certain parameters that characterize our objects and then normalize the highlighted characteristics. Although improvement of forecasting accuracy through the clustering of weather conditions has been studied by many authors, for example [42; 43; 44; 45], there is still a place for improvement in regard to the clustering application for this task. In [42], weather data spread in four groups defined only using meteorological provider labels such as snowy, foggy, sunny and rainy. The authors of [43] applied the DBSCAN method to differentiate clusters in data but divided them by the average value first. In [44], a clustering algorithm was based on only two features (irradiance and temperature). The above-mentioned research barely used any of clustering metrics to evaluate and describe the obtained results, but some authors [45; 46] used a silhouette coefficient for evaluation. The main contributions of this research to the field of PV generation forecasting and weather clustering are as follows:  
* Relevant weather features which determine the working state of PV modules were used as initial data for the clustering algorithm;
* Three metrics (silhouette, WSS, and BSS) for data spreading in clusters were used;
* The clustering model was applied to hourly observations to define similar groups of data in terms of the working state of PV modules instead of labeling whole days as rainy or sunny;  
This paper's content is structured as follows. Section 2 presents the applied data preprocessing actions, clustering methods, forecasting models and evaluation metric descriptions.