## 3 Scene Reduction Method Based on Improved Clustering Algorithm  
Cluster analysis is a common method for scene analysis in the DG planning process. Cluster analysis groups the same or similar scenarios in DG and load output scenarios, and obtains the classes of similar elements. Clustering algorithms have been widely used in data analysis. For different sets, different classes are needed, so the clustering algorithms have been improved from the corresponding aspects in the specific application at this stage. In this section, we will introduce the common clustering algorithms. In view of the shortcomings of clustering algorithms and the set of scenarios used in this paper, we propose a kind of improved clustering algorithm. Figure 8: Typical photovoltaic output curve. Figure 7: Continuous multi-day photovoltaic output curve. 1 Choosing a center according to the maximum and minimum distance criterion described above
2 Clustering according to k-means clustering method based on maximum and minimum distance
3 Calculate the BWP value of the clustering result and turn to step 2
4 Comparing the BWP value of clustering results, the \(k\) value of clustering results is the best clustering number when the BWP value is maximum
5 Clustering results corresponding to the maximum output BWP value  
In the process of clustering research and application, there are usually two problems to be solved. One is how to divide a given data set so as to optimize the result. The other is how to divide the data set into the most suitable categories. Among them, the first problem is solved by a clustering algorithm, and the second problem is clustering validation. Although in some applications, the number of clusters can be estimated by a user's experience and domain knowledge, in general, the number of clusters cannot be known in advance, so it is difficult to determine the optimal number of clusters [25]. According to the different components of clustering validity index, it can also be divided into clustering validity index considering only the geometric structure information of data sets, clustering validity index considering only membership degree, and clustering validity index considering both geometric structure information and membership degree of data sets. Among them, data set geometric structure information refers to information extracted from data partition features, such as compactness, separation, connectivity and overlap. Clustering validity index considering only geometric structure information of data sets can be used not only for hard clustering, but also for validity evaluation of fuzzy clustering. Clustering validity index considering only membership degree or considering both geometric structure information and membership degree of data sets can only be used for validity evaluation of fuzzy clustering [26]. Common indicators for k-means clustering algorithm include DB index, I index, CH index, Xie-Beni index, Dunn index, Sil index and so on. The above indicators are tested by artificial simulated data sets and UCI real data sets, respectively [27]. According to the experimental results, the Xie-Beni index, DB index, Dunn index and Sil index give good results only when evaluating the best clustering number of clustering structure features which are far apart and completely separated, but not for other clustering features. Because of the complexity of clustering structure of real data sets, only CH index and I index have significant effect. Xie-Beni index, DB index, Dunn index and Sil index are only good for data sets with 2 clustering numbers because of their own limitations. Therefore, CH index and I index are two good choices when evaluating the optimal clustering number of k-means algorithm. It should be pointed out that when the scene reduction method based on improved clustering algorithm is used to reduce the specific scene, the reduced scene with larger BWP value can be selected according to the actual scene reduction requirement rather than the maximum value.