A daily load curve clustering method and its application
By improving the local density calculation and sample allocation strategy, and using K-nearest neighbors and fitting piecewise functions to determine the cluster centers, the shortcomings of traditional clustering methods on complex load datasets are solved, and more accurate and adaptive clustering results are achieved.
Patent Information
- Application Number
- CN202110922940.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-08-12
AI Technical Summary
Traditional clustering methods perform poorly on complex and imbalanced load datasets, cannot adaptively determine cluster centers, and are prone to errors in sample allocation strategies.
By adopting the ideas of K-nearest neighbors and relative density, cluster centers are determined by fitting piecewise functions, improving local density calculation and sample allocation strategies, and using weighted KNN graphs to measure the similarity between samples and cluster centers.
It improves the accuracy and adaptability of clustering results, making it applicable to arbitrary cluster distributions, reducing the need for manual parameter settings, and improving the accuracy of sample allocation.
Smart Images

Figure CN115705408B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a daily load curve clustering method and its application. Background Technology
[0002] As power system reform moves towards marketization, electricity retailers are increasingly emphasizing the user experience. Faced with a more competitive market environment, to improve customer service and gain market share, electricity retailers need to extract user electricity consumption characteristics from massive and diverse electricity data, fully understand user electricity preferences, and thus assist in load forecasting, participating in demand-side response, and formulating electricity pricing and other marketing strategies. Cluster analysis of users' daily load curves to scientifically and rationally segment user groups is an important means for electricity retailers to analyze user electricity consumption characteristics.
[0003] However, with the gradual opening of the electricity market and the integration of a large amount of renewable energy, users have greater freedom in electricity consumption, increasing the randomness and volatility of loads and the differences in load characteristics among users. This leads to a more complex sample distribution of the collected load data, resulting in load datasets with large differences in cluster shapes and uneven distribution. Traditional clustering algorithms perform poorly on such datasets. Furthermore, if certain parameters need to be manually adjusted for each clustering analysis, it is clearly detrimental to practical applications.
[0004] Traditional clustering methods use the DPC algorithm, with the following specific steps:
[0005] (1) Calculate the local density: the local density ρ of the sample point i There are two calculation methods: truncated kernel and Gaussian kernel, as shown in formulas (1) and (2) respectively.
[0006] Truncated kernel calculation method:
[0007]
[0008] Gaussian kernel calculation method:
[0009]
[0010] Where x < 0, then χ(x) = 1; otherwise, χ(x) = 0; d i,j For sample point x i and x j The Euclidean distance between them; d c For the cutoff distance (d) c >0), which is usually the value selected from the top 2% of the distances between all sample points.
[0011] (2) Calculate the minimum distance: minimum distance δ iIt represents the distance between a sample point and the nearest sample point with a density higher than its own.
[0012]
[0013] (3) Draw a decision graph and determine the cluster centers: The DPC algorithm considers clusters with high local density ρ to be simultaneously located in the cluster. i and the larger minimum distance δ i The sample points are the density peak points, i.e., the cluster centers. The decision value γ is calculated. i The density peak point can be directly determined, and the decision value γ can be used. i The definition is as follows:
[0014] γ i =ρ i ·δ i (4)
[0015] Arrange the γ values in descending order, and use the descending γ values as the ordinate and the order of arrangement as the abscissa to form a decision graph. Then, select the first c points whose γ values are much larger than the remaining samples as the cluster centers based on the decision graph.
[0016] (4) Sample allocation: In the order of decreasing local density, the remaining sample points are sequentially allocated to the clusters of sample points with higher local density and the closest distance.
[0017] The traditional DPC algorithm has the following drawbacks when applied to daily load curve clustering with complex cluster distribution: (1) The local density defined by the DPC algorithm does not consider the structural differences within the data. When the density differences between clusters are too large, the local density calculated by using a fixed cutoff distance cannot truly reflect the density of the sample points. For example Figure 1 As shown, regardless of the cutoff distance, the local density of all sample points within the lower left circle is selected from the sample points within the upper right circle. Since the decision value is determined by the product of local density and minimum distance, when the difference in local density between samples is too large, it will affect the determination of the cluster center. (2) The cluster center needs to be determined manually through the decision graph. (3) If the uneven distribution of data samples or the existence of a manifold structure leads to some cluster edge points being close to other clusters, the allocation strategy of the DPC algorithm will cause incorrect sample allocation, and once a sample point is incorrectly allocated, subsequent allocations will further amplify this error. Figure 1 As shown, point B is closest to point A and has a lower local density than point A. According to the sample allocation strategy, point B and point A belong to the same cluster. Summary of the Invention
[0018] The purpose of this invention is to provide a daily load curve clustering method and its application, which solves the problems that traditional clustering methods cannot be applied to arbitrary cluster distributions and lack adaptive capabilities.
[0019] Furthermore, this invention also provides applications of the above-described clustering method.
[0020] This invention is achieved through the following technical solution:
[0021] A daily load curve clustering method includes the following steps:
[0022] S1. Obtain user daily load curve data, and map the daily load curve data from high dimension to two-dimensional plane to form a two-dimensional mapping distribution map through multi-dimensional scaling transformation;
[0023] S2. Obtain sample points x based on the two-dimensional mapping distribution map obtained in step S1. i and x j The Euclidean distance d between them i,j Determine the relationship with sample x i KNN is the set of the k nearest sample points. k (x i ), where the value of k is obtained through the natural nearest neighbor algorithm;
[0024] S3, d obtained based on step S2 i,j and KNN k (x i Constructing local density ρ i The computational model is used to calculate the local density ρ. i The calculation models ', minimum distance δ, and decision value γ respectively calculate the local density ρ', minimum distance δ, and decision value γ of the sample;
[0025] S4. Based on the segmentation characteristics of the descending order of decision values γ, cluster centers are selected by fitting piecewise functions.
[0026] S5. Assign the remaining sample points according to the sample allocation strategy based on the weighted KNN graph to achieve sample clustering.
[0027] The concept of this invention is as follows:
[0028] First, a novel density metric is proposed based on the concepts of K-Nearest Neighbor (KNN) and relative density. Then, the optimal number of clusters is determined by fitting a piecewise function to the decision graph. Finally, a weighted KNN graph is constructed, which takes into account both attribute similarity and structural similarity between samples, and measures the similarity between samples and cluster centers based on the distance in the graph, thereby improving the sample allocation strategy.
[0029] To consider the internal structure of samples when calculating local density, this invention utilizes the concept of K-nearest neighbors. The local density of a sample point is reflected by the average distance between the sample point and its k nearest neighbors; the shorter the average distance, the greater the local density. The natural nearest neighbor (3N) algorithm (which can be seen as a K-nearest neighbor algorithm that automatically obtains the value of k) is used to calculate the natural feature value sup. k The k value is used in the KNN algorithm.
[0030] Among them, KNN k (x i ) for x i The set of the k nearest sample points. The improved local density can amplify the local density of sparse cluster sample points and reduce the local density of dense cluster sample points, avoiding the problem of not being able to accurately determine the cluster center due to excessive differences in cluster density.
[0031] This invention considers that the decision value of the cluster center is much larger than that of other sample points. Arranging the decision values in descending order would result in obvious segmentation. Based on this, the decision values are piecewise fitted using two linear functions. The segment point where the function fitting error is minimized is the optimal number of cluster centers.
[0032] In summary, this invention solves the problems of traditional clustering methods being unable to be applied to arbitrary cluster distributions and lacking adaptability.
[0033] Furthermore, in step S2, the specific process of the natural nearest neighbor algorithm is as follows:
[0034] Step 21: Initialize the search index r = 1, and the inverse nearest neighbor set.
[0035] Step 22: Calculate x for each sample i KNN r (x i ), RNN(x i );
[0036] Step 23, let r = r + 1, when Make or all orders x j When it no longer changes, sup k =r-1 output sup k Otherwise, proceed to step 22;
[0037] The following definitions are made:
[0038] Inverse nearest neighbor: If sample point x j It is the sample point x iIf a point x is one of the K-nearest neighbors, then the sample point x is called a sample point x. i It is the sample point x j The inverse nearest neighbor, denoted as x. i ∈RNN(x j );
[0039] Natural steady state: During the natural neighbor search process, if every data point has an inverse nearest neighbor or when the number of all inverse nearest neighbors is 0, the natural neighbor search reaches a natural steady state.
[0040] Natural eigenvalue: When the search for natural neighbors reaches a natural steady state, the number of searches for natural neighbors is the natural eigenvalue, representing the average number of nearest neighbor nodes in the data sample, denoted as sup. k ;
[0041] Among them, the natural feature value sup was calculated. k In the KNN algorithm, k is the value of r, where r is a natural number less than or equal to k. r (x i ) is x i The set of the r nearest sample points; For any sample point.
[0042] Furthermore, in step S3, the local density ρ i The calculation model for ' is as follows:
[0043]
[0044] In the formula, d i,j For sample point x i and x j Euclidean distance between them, KNN k (x i ) for sample x i The set of the k nearest sample points; KNN k (x j ) for sample x j The set of the k nearest sample points, d i,l For sample point x i and x l The Euclidean distance between them.
[0045] Furthermore, in step S3, the minimum distance δ i The calculation model is as follows:
[0046]
[0047] In the formula, d i,j For sample point x i and x jThe Euclidean distance between them.
[0048] Furthermore, in step S3, the decision value γ is calculated using the following model:
[0049] γ i =ρ i ′·δ i
[0050] In the formula, ρ i ' represents the local density, δ i The minimum distance.
[0051] Furthermore, in step S4, the specific selection process for the cluster center is as follows:
[0052] Step S41: Sort the decision values γ in descending order, with n points (i, p) i Let S' be the dataset S, and let the first point in dataset S be S1 and the last point be S''. n ;
[0053] Step S42: Set the initial value of the segmentation point t = 2, and pass through points S1 and S2 respectively. t And points S1, S n Draw straight lines to obtain y1 = a1x + b1 and y2 = a2x + b2; calculate the fitted values y for x = 1, 2, ..., n respectively. * ;
[0054] Step S43: Calculate the fitting error θ based on the following model. t :
[0055]
[0056] Step S44: Let t = t + 1. If t > n, go to step S45; otherwise, go to step S42.
[0057] Step S45: Find the smallest θ t t represents the optimal number of cluster centers, and the sample points corresponding to the first t γ values are the cluster centers v = [v1, v2, ... v2]. t ].
[0058] Furthermore, in step S5, the allocation of the remaining sample points takes into account both structural similarity and attribute similarity between samples.
[0059] Furthermore, in step S5, the specific process for allocating the remaining sample points is as follows:
[0060] Step S51: Construct a weighted KNN graph G = (V, E, W): Using all sample points as the node set V, if x... j ∈KNN k (x iThen there is an edge e between the two nodes. i,j ∈E, the combined weight W of the edge i,j The definition is as follows:
[0061] W i,j =d i,j +(1-J i,j )
[0062]
[0063] Where, d i,j For sample point x i With x j The Euclidean distance between samples represents the attribute similarity between them; J i,j ∈[0,1] represents the Jaccard coefficient, indicating the structural similarity between samples. The more common adjacent points two nodes share in a KNN graph, the larger the Jaccard coefficient, meaning the two nodes are more structurally similar; Γ(x i ) is node x i The set of adjacent points, Γ(x) j Node x j The set of adjacent points. The comprehensive weight of the edges takes into account both the attribute similarity and structural similarity between sample points, and amplifies the differences between nodes of different clusters through the connection structure of the samples in the graph;
[0064] Step S52: Calculate the shortest path from each cluster center to the remaining nodes in the weighted KNN graph using the Dijkstra algorithm to obtain the shortest path matrix L, as shown in the following formula. The shorter the path, the more similar the node is to the cluster center.
[0065]
[0066] Step S53: Assign non-cluster centroids to their respective clusters according to the following formula:
[0067]
[0068] In the formula, t is the number of cluster centers, and K is the number of sample points x. i The number of the most recent sample points, distance from sample point x i The nearest cluster center.
[0069] Furthermore, in step S1, the daily load curve data is first preprocessed and then a two-dimensional mapping distribution map is formed. The preprocessing includes interpolation, smoothing and normalization.
[0070] An application of a daily load curve clustering method in sample clustering analysis, wherein the samples include daily load data of electricity consumption, daily load data of water consumption, and daily load data of gas consumption.
[0071] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0072] 1. Compared with traditional methods, the method described in this invention provides more accurate clustering results, is applicable to any cluster distribution, and has adaptive capabilities.
[0073] 2. The improved local density calculation model of this invention can amplify the local density of sparse cluster sample points and reduce the local density of dense cluster sample points, thus avoiding the problem of not being able to accurately determine the cluster center due to the large difference in cluster density, and eliminating the need to manually set the cutoff distance parameter.
[0074] 3. This invention determines the optimal number of clusters by fitting a piecewise function to the decision graph, eliminating the need for manual determination of the number of clusters.
[0075] 4. This invention improves the sample allocation strategy of the DPC algorithm by using a weighted KNN graph, which takes into account both attribute similarity and structural similarity between samples, and measures the similarity between samples and cluster centers based on graph distance, thereby improving the accuracy of sample allocation. Attached Figure Description
[0076] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0077] Figure 1 This is a sample distribution diagram for the DPC algorithm.
[0078] Figure 2 This is a fitting graph of the decision values for this invention;
[0079] Figure 3 This is a flowchart of the present invention;
[0080] Figure 4 This is a two-dimensional mapping of the real load dataset in Application Case 1 of this invention;
[0081] Figure 5 This is a clustering result diagram of a real load dataset using the ISDPC algorithm in an application case of the present invention.
[0082] Figure 6 This is a clustering result diagram of a real load dataset using the DPC algorithm in an application case of the present invention.
[0083] Figure 7 This is a two-dimensional mapping of the real load dataset in application example two of this invention;
[0084] Figure 8 This is a clustering result diagram of the real load dataset using the ISDPC algorithm in application case two of this invention;
[0085] Figure 9 This is the second application example of the present invention, which uses the DPC algorithm to make decision graphs at different cutoff distances. Detailed Implementation
[0086] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are only for explaining this invention and are not intended to limit this invention.
[0087] Example 1:
[0088] like Figure 3 As shown, a daily load curve clustering method includes the following steps:
[0089] S1. Obtain user daily load curve data, and perform preprocessing such as interpolation, smoothing, and normalization on the daily load curve data. Then, through multidimensional scaling transformation, map the daily load curve data from high dimension to two-dimensional plane to form a two-dimensional mapping distribution map.
[0090] S2. Obtain sample points x based on the two-dimensional mapping distribution map obtained in step S1. i and x j The Euclidean distance d between them i,j Determine the relationship with sample x i KNN is the set of the k nearest sample points. k (x i ), where the value of k is obtained through the natural nearest neighbor algorithm;
[0091] However, the specific process of the nearest neighbor algorithm is as follows:
[0092] Step 21: Initialize the search index r = 1, and the inverse nearest neighbor set.
[0093] Step 22: Calculate x for each sample i KNN r (x i ), RNN(x i );
[0094] Step 23, let r = r + 1, when Make or all orders x j When it no longer changes, sup k =r-1 output sup k Otherwise, proceed to step 22;
[0095] The following definitions are made:
[0096] Inverse nearest neighbor: If sample point x j It is the sample point x i If a point x is one of the K-nearest neighbors, then the sample point x is called a sample point x. i It is the sample point x j The inverse nearest neighbor, denoted as x. i ∈RNN(x j );
[0097] Natural steady state: During the natural neighbor search process, if every data point has an inverse nearest neighbor or when the number of all inverse nearest neighbors is 0, the natural neighbor search reaches a natural steady state.
[0098] Natural eigenvalue: When the search for natural neighbors reaches a natural steady state, the number of searches for natural neighbors is the natural eigenvalue, representing the average number of nearest neighbor nodes in the data sample, denoted as sup. k ;
[0099] Among them, the natural feature value sup was calculated. k In the KNN algorithm, k is the value of r, where r is a natural number less than or equal to k. r (x i ) is x i The set of the r nearest sample points; For any sample point;
[0100] S3, d obtained based on step S2 i,j and KNN k (x i Constructing local density ρ i The computational model is used to calculate the local density ρ. i The calculation models ', minimum distance δ, and decision value γ respectively calculate the local density ρ', minimum distance δ, and decision value γ of the sample;
[0101] In step S3, the local density ρ i The calculation model for ' is as follows:
[0102]
[0103] In the formula, d i,j For sample point x i and x j Euclidean distance between them, KNN k (x i ) for sample x i The set of the k nearest sample points; KNN k (x j ) for sample x j The set of the k nearest sample points, d i,l For sample point xi and x l The Euclidean distance between them;
[0104] Minimum distance δ i The calculation model is as follows:
[0105]
[0106] In the formula, d i,j For sample point x i and x j The Euclidean distance between them;
[0107] The decision value γ is calculated using the following model:
[0108] γ i =ρ i ′·δ i ;
[0109] In the formula, ρ i ' represents the local density, δ i Minimum distance;
[0110] S4. Based on the segmented characteristics of the descending order of decision values γ, cluster centers are selected by fitting a piecewise function, such as... Figure 2 As shown;
[0111] The specific process for selecting the cluster center is as follows:
[0112] Step S41: Sort the decision values γ in descending order, with n points (i, p) i Let S' be the dataset S, and let the first point in dataset S be S1 and the last point be S''. n ;
[0113] Step S42: Set the initial value of the segmentation point t = 2, and pass through points S1 and S2 respectively. t And points S1, S n Draw straight lines to obtain y1 = a1x + b1 and y2 = a2x + b2; calculate the fitted values y for x = 1, 2, ..., n respectively. * ;
[0114] Step S43: Calculate the fitting error θ based on the following model. t :
[0115]
[0116] Step S44: Let t = t + 1. If t > n, go to step S45; otherwise, go to step S42.
[0117] Step S45: Find the smallest θ tt represents the optimal number of cluster centers, and the sample points corresponding to the first t γ values are the cluster centers v = [v1, v2, ... v2]. t ];
[0118] S5. Assign the remaining sample points according to the sample allocation strategy based on the weighted KNN graph to achieve sample clustering;
[0119] The specific process for allocating the remaining sample points is as follows:
[0120] Step S51: Construct a weighted KNN graph G = (V, E, W): Using all sample points as the node set V, if x... j ∈KNN k (x i Then there is an edge e between the two nodes. i,j ∈E, the combined weight W of the edge i,j The definition is as follows:
[0121] W i,j =d i,j +(1-J i,j )
[0122]
[0123] Where, d i,j For sample point x i With x j The Euclidean distance between samples represents the attribute similarity between them; J i,j ∈[0,1] represents the Jaccard coefficient, indicating the structural similarity between samples. The more common adjacent points two nodes share in a KNN graph, the larger the Jaccard coefficient, meaning the two nodes are more structurally similar; Γ(x i ) is node x i The set of adjacent points, Γ(x) j Node x j The set of adjacent points. The comprehensive weight of the edges takes into account both the attribute similarity and structural similarity between sample points, and amplifies the differences between nodes of different clusters through the connection structure of the samples in the graph;
[0124] Step S52: Calculate the shortest path from each cluster center to the remaining nodes in the weighted KNN graph using the Dijkstra algorithm to obtain the shortest path matrix L, as shown in the following formula. The shorter the path, the more similar the node is to the cluster center.
[0125]
[0126] Step S53: Assign non-cluster centroids to their respective clusters according to the following formula:
[0127]
[0128] In the formula, t is the number of cluster centers, and K is the number of sample points x. i The number of the most recent sample points, distance from sample point x i The nearest cluster center.
[0129] Case 1
[0130] Figure 4 This is a distribution map of a real dataset (commercial and industrial user load data published by the U.S. Department of Energy's OpenEI, consisting of 2260 weekday load curves) that maps data samples from high dimensions to a two-dimensional plane using Multiple Dimensional Scalling (MDS).
[0131] The ISDPC algorithm is used to obtain the cluster partitioning results of the real dataset, such as Figure 5 As shown, user load curves are divided into 7 categories, which can be categorized into 4 types: single-peak, double-peak, triple-peak, and peak-avoidance. Categories 3 and 4 are single-peak loads, mainly including schools, retail, hospitals, and other industries, with electricity consumption concentrated during the daytime. Category 3 users exhibit long-duration peak electricity consumption characteristics during the day, from approximately 6:00 AM to 8:00 PM; Category 4 users have slightly shorter daytime electricity consumption than Category 3, and their electricity consumption decreases slightly during the midday break. Categories 1, 2, and 5 are double-peak loads, mainly including residential, hotel, and other industries, exhibiting morning and evening peak electricity consumption characteristics. Category 5 users consume more electricity during the morning peak than the evening peak; Category 1 and 2 users have similar morning and evening peak consumption, but Category 2 users have extremely low electricity consumption at midday, showing a clear midday break phenomenon. Category 6 is a triple-peak load, possibly belonging to the catering industry, exhibiting peak electricity consumption in the morning, noon, and evening, with a decrease in electricity consumption during the morning work hours and midday break, and a significant decrease in electricity consumption in the early morning. Category 7 is peak-avoidance load, which may be high-energy-consuming enterprise users who choose to carry out production tasks at night in order to reduce electricity costs, thus exhibiting nighttime electricity consumption characteristics.
[0132] The traditional DPC algorithm exhibits varying clustering results depending on the set cutoff distance parameter, as shown in Table 1. (Table 1 illustrates how different cutoff distances can affect clustering performance.) c The clustering effect is best when the value is 0.396. Figure 6 This shows the clustering results at this cutoff distance. (Comparison) Figure 5 and Figure 6 It can be seen that the DPC algorithm incorrectly classified the partial load curve belonging to category 2 into category 5, which proves that the sample allocation strategy of the ISDPC algorithm is superior to that of the DPC algorithm.
[0133] Table 2 compares the clustering performance of the four algorithms. For a load dataset with a uniform distribution and similar cluster shapes, all four algorithms have good clustering performance, with ISDPC and k-means algorithms performing slightly better than the other two.
[0134] Case 2
[0135] The simulated load dataset is based on seven typical daily load curves, with noise added to create the dataset. Different perturbation ratios and sample sizes are applied to each cluster to obtain a simulated load dataset with an uneven cluster distribution, as shown in the two-dimensional distribution below. Figure 7 As shown.
[0136] The clustering results of the four algorithms are shown in Table 3. For cluster analysis of unbalanced load samples, the DPC, k-means, and FCM algorithms are not ideal, and only the ISDPC algorithm can accurately divide the various clusters. Figure 8 The image shows the decision graph and result distribution of the ISDPC algorithm on a simulated load dataset. The DPC algorithm consistently failed to achieve satisfactory clustering results despite continuously adjusting the cutoff distance parameter, exhibiting the following two scenarios: when the cutoff distance is small, the number of density peaks (cluster centers) detected far exceeds the actual number, such as... Figure 9 (a) When the cutoff distance is large, there are only two density peak points, such as Figure 9 (b) It can be seen that when the cluster distribution of the load dataset is uneven, the cluster center cannot be accurately identified by a fixed cutoff distance; however, this invention can accurately identify the cluster center without setting any parameters by improving the local density calculation method of the DPC algorithm.
[0137] Cluster analysis of simulated load datasets under different noise ratios was performed using ISDPC and k-means algorithms, respectively. The robustness of the algorithms was tested by the number of optimal clusters, the SC index, and the accuracy. Accuracy T is the ratio of the number of correctly classified load curves to the total number of clusters. Table 4 compares the results of the two methods under different noise ratios r. It is evident that as the noise ratio increases, the SC index gradually decreases, the number of optimal clusters becomes biased, and the accuracy T gradually decreases. The proposed method achieves completely correct clustering results up to r = 30%, demonstrating good robustness. In contrast, the k-means algorithm begins to show bias in its clustering results at r = 20%, exhibiting poor robustness. This is because k-means only uses the Euclidean distance between samples as a similarity measure; when noise disturbances are large, samples of similar categories are grouped together.
[0138] Table 1. Clustering results of DPC algorithm under different cutoff distances
[0139]
[0140]
[0141] Table 2 Comparison of clustering performance of different algorithms on real workload datasets.
[0142]
[0143] Table 3 Comparison of clustering effects of different algorithms on simulated load datasets
[0144]
[0145] Table 4 Comparison of Algorithm Robustness
[0146]
[0147] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A daily load curve clustering method, characterized in that, Includes the following steps: S1. Obtain user daily load curve data, and map the daily load curve data from high dimension to two-dimensional plane to form a two-dimensional mapping distribution map through multi-dimensional scaling transformation; S2. Obtain sample points based on the two-dimensional mapping distribution map obtained in step S1. and Euclidean distance between Determine the sample The closest k The set of sample points ,in, k The value of is obtained through the natural nearest neighbor algorithm; S3, based on the results obtained in step S2 and Constructing local density The computational model is then used to calculate the local density. The calculation model and minimum distance Computational model and decision value The computational model calculates the local density of the samples respectively. Minimum distance and decision value ; Local density The calculation model is as follows: ; In the formula, For sample points and The Euclidean distance between them To be consistent with the sample The closest k The set consisting of 100 sample points; To be consistent with the sample The closest k The set consisting of sample points For sample points and The Euclidean distance between them; S4. Based on the decision value Based on the segmented characteristics of the descending order, cluster centers are selected by fitting piecewise functions. S5. Assign the remaining sample points according to the sample allocation strategy based on the weighted KNN graph to achieve sample clustering.
2. The daily load curve clustering method according to claim 1, characterized in that, In step S2, the specific process of the natural nearest neighbor algorithm is as follows: Step 21: Initialize the search index Inverse nearest neighbor set ; Step 22: Calculate for each sample of , ; Step 23, let when Make or all orders When it no longer changes, Output Otherwise, proceed to step 22; The following definitions are made: Inverse nearest neighbor: If the sample point yes One of the K-nearest neighbors is called a sample point. Sample points The inverse nearest neighbor is denoted as ; Natural steady state: In the natural neighbor search process, if every data point has an inverse nearest neighbor or when all inverse nearest neighbors are in a stable state. When the number of data points equal to 0 remains unchanged, the natural neighbor search reaches a natural steady state. Natural eigenvalue: When the search for natural neighbors reaches a natural steady state, the number of searches for natural neighbors is the natural eigenvalue. The eigenvalue represents the average number of nearest neighbor nodes in a data sample, denoted as . ; Among them, the natural feature values are calculated. As the KNN algorithm k value, r less than or equal to k natural numbers, for The closest r The set consisting of 100 sample points; For any sample point.
3. The daily load curve clustering method according to claim 1, characterized in that, In step S3, the minimum distance δ i The calculation model is as follows: ; In the formula, For sample points and The Euclidean distance between them.
4. The daily load curve clustering method according to claim 1, characterized in that, In step S3, the decision value The calculation model is as follows: In the formula, For local density, δ i The minimum distance.
5. The daily load curve clustering method according to claim 1, characterized in that, In step S4, the specific selection process for the cluster center is as follows: Step S41: Set the decision value Sort in descending order, with n points Let S be the dataset S, with the first point in S1 and the last point in S2. n ; Step S42: Set the initial value of the segmentation point t=2, and pass through points S1 and S2 respectively. t S1, S n Draw a straight line to get and Calculate the fitted values for x = 1, 2, ..., n respectively. ; S43. Calculate the fitting error based on the following model. : ; Step S44: Let t = t + 1. If t > n, go to step S45; otherwise, go to step S42. Step S45: Find the smallest t represents the number of optimal cluster centers, the first t... The sample point corresponding to the value is the cluster center v=[v1,v2,…v t ].
6. The daily load curve clustering method according to claim 1, characterized in that, In step S5, the allocation of the remaining sample points takes into account both structural similarity and attribute similarity between samples.
7. The daily load curve clustering method according to claim 6, characterized in that, In step S5, the specific process of allocating the remaining sample points is as follows: Step S51: Construct a weighted KNN graph : Taking all sample points as the node set V, if the following conditions are met... Then there is an edge between the two nodes. The overall weight of the edges The definition is as follows: in, For sample points and The Euclidean distance between samples represents the attribute similarity between them; The Jaccard coefficient represents the structural similarity between samples; For nodes The set of adjacent points; node The set of adjacent points; Step S52: Calculate the shortest paths from the cluster centers of each type to the remaining nodes in the weighted KNN graph using Dijkstra's algorithm, and obtain the shortest path matrix L; Step S53: Assign non-cluster centroids to their respective clusters according to the following formula: In the formula, t is the number of cluster centers, and K is the number of sample points. The number of the most recent sample points, Distance from sample point The nearest cluster center.
8. A daily load curve clustering method according to any one of claims 1-7, characterized in that, In step S1, the daily load curve data is first preprocessed and then a two-dimensional mapping distribution map is formed. The preprocessing includes interpolation, smoothing and normalization.
9. The application of the daily load curve clustering method as described in claim 8 in sample cluster analysis, characterized in that, The sample includes daily load data for electricity, water, and gas.
Citation Information
Patent Citations
A density-based hierarchical clustering method
CN109948720A