Photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm

By improving the k-means clustering analysis and fusing the random forest algorithm, combined with the fitting residual algorithm, the problems of insufficient utilization of feature information and single model in photovoltaic power prediction are solved, and photovoltaic power prediction with higher accuracy and robustness is achieved.

CN115204444BActive Publication Date: 2025-10-03SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210534698.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-10-03
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

Among the existing photovoltaic power prediction methods, k-means cluster analysis fails to fully explore the influence of other feature information, and the prediction model is relatively simple, resulting in insufficient prediction accuracy and limited generalization performance.

Method used

An improved k-means clustering analysis method is used, combined with the fusion random forest algorithm and the fitting residual algorithm. The data are screened by calculating the MIE comprehensive similarity, and a fitting residual random forest model is established. The weights are assigned according to the iterative error value to perform weighted cumulative prediction.

Benefits of technology

The accuracy and robustness of photovoltaic power prediction are improved, the risk of overfitting is reduced, and the generalization ability of the prediction model is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115204444B_ABST
    Figure CN115204444B_ABST
Patent Text Reader

Abstract

The present invention discloses a photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm. The improved k-means cluster analysis method is used to calculate the comprehensive similarity of MIE of various types of days with a reference day, and data with low similarity are eliminated to obtain more accurate classification results. A fitting residual random forest prediction model is established by fusing a random forest algorithm and a fitting residual algorithm. The residual of the previous random forest is used as training data for the next random forest. Each new random forest is established to reduce the residual of the previous random forest in the gradient direction. The improved fitting residual algorithm is used to assign a corresponding weight to the output result of each random forest according to the decrease in the prediction error value of the random forest model after each iteration. The final prediction result is the weighted accumulation of the output results of the random forest model after each iteration, thereby greatly improving the photovoltaic prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of photovoltaic power prediction, relates to the technology of renewable energy output prediction, and in particular to a photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm. Background Art

[0002] In the new era, reducing thermal power pollution and developing clean energy are urgent priorities. Solar photovoltaic power generation, as a representative of new energy, has experienced rapid growth in recent years. Photovoltaic power generation is affected by meteorological factors such as solar radiation intensity, temperature, humidity, air pressure, precipitation, and ventilation conditions, and is characterized by intermittent, fluctuating, and random characteristics. As photovoltaic penetration in power grids continues to increase, this will have an increasingly severe negative impact on grid security, stability, and economic operations. Therefore, it is crucial to thoroughly explore and study the key factors affecting photovoltaic system output power and to provide timely and accurate power forecasts.

[0003] Among the currently commonly used clustering algorithms, k-means clustering analysis only considers one feature and fails to fully explore the impact of information in other features on prediction accuracy.

[0004] Moreover, most current photovoltaic power prediction methods are limited to using a single prediction model, resulting in limited generalization performance, or simply combining models through simple arithmetic averaging, lacking sufficient theoretical support. Summary of the Invention

[0005] The present invention is aimed at the problem that the existing technology fails to fully explore the influence of other feature information on prediction accuracy and the existing prediction model is relatively single. It provides a photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm. Through the improved k-means cluster analysis method, the comprehensive similarity of MIE of each day with the base day is calculated, and the data with similarity lower than the threshold α is eliminated to obtain a more accurate classification result; by establishing a fitting residual random forest prediction model that integrates the random forest algorithm and the fitting residual algorithm, the residual of the previous random forest is used as the training data of the next random forest. The establishment of each new random forest is to make The residual of the previous random forest decreases in the direction of the gradient; when the prediction error of the new random forest model decreases below the set threshold compared with the prediction error of the previous random forest model, the fitted residual random forest model will terminate the iteration; by improving the fitted residual algorithm, a corresponding weight is assigned to the output result of each random forest according to the decrease in the prediction error value of the random forest model after each iteration. The final prediction result is the weighted accumulation of the output results of the random forest model after each iteration, which overcomes the problems of inaccurate classification of the k-means clustering method based on only one feature and the limited generalization performance of a single prediction model, thereby improving the photovoltaic prediction accuracy.

[0006] To achieve the above objectives, the present invention adopts a technical solution: a photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm. In the prediction method, the improved k-means cluster analysis method is used to calculate the comprehensive similarity of MIE of each day with the base day, and data with similarity below a threshold α is eliminated to obtain a more accurate classification result;

[0007] By establishing a fitted residual random forest prediction model that integrates the random forest algorithm and the fitted residual algorithm, the residual of the previous random forest is used as the training data for the next random forest. The establishment of each new random forest is to reduce the residual of the previous random forest in the direction of the gradient. When the prediction error of the new random forest model decreases below the set threshold compared with the prediction error of the previous random forest model, the fitted residual random forest model will terminate the iteration.

[0008] By improving the fitting residual algorithm, a corresponding weight is assigned to each random forest output result according to the decrease in the prediction error value of the random forest model after each iteration. The final prediction result is the weighted accumulation of the output results of the random forest model after each iteration.

[0009] In order to achieve the above object, the present invention also adopts a technical solution: a photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm, which specifically includes the following steps:

[0010] S1, data preprocessing, feature correlation analysis and feature construction: Preprocess the actual photovoltaic power values ​​and meteorological values ​​to find outliers; perform correlation analysis based on whether there is linear correlation between features and between features and labels. Based on the correlation analysis results, remove the features with extremely weak correlation to the label and the features with strong linear correlation that have less correlation to the label, and construct new features;

[0011] S2, k-means clustering based on shortwave radiation flux, using the elbow plot to determine the optimal number of clusters k: perform k-means clustering based on shortwave radiation flux on the training set data, and use the following formula to calculate the intra-cluster error variance (SSE). Based on the relationship between the intra-cluster error variance (SSE) and the number of clusters, the elbow plot is used to determine the optimal number of clusters k for the data.

[0012]

[0013] Where SSE is the within-cluster error variance; C i represents the i-th cluster, i = 1, 2, 3, ..., k; p is C i The shortwave radiation flux of the sample in m i It is C i The center of mass, C i The average value of the shortwave radiation flux of all sample points in ;

[0014] S3, based on the mutual information entropy (MIE) comprehensive similarity screening, obtain more accurate clustering results: calculate the MIE comprehensive similarity of each day with the base day, eliminate the data with similarity lower than the threshold α, and obtain more accurate classification results. The MIE comprehensive similarity calculation formula is:

[0015]

[0016]

[0017] Where w j is the MIE weight factor of meteorological factor j and photovoltaic power, W is the sum of all weight factors, I NM,i,j is the MIE correlation coefficient of meteorological factor j between the i-th day of each category and the benchmark day of the category, MCS i is the comprehensive similarity between the weather conditions on the i-th day of each category and the weather conditions on the base day of that category;

[0018] S4, establishing a fitted residual random forest model: the model is as follows: the residual of the previous random forest is used as the training data for the next random forest. Each new random forest is established to reduce the residual of the previous random forest in the gradient direction. When the prediction error of the new random forest model decreases below the set threshold compared with the prediction error of the previous random forest model, the fitted residual random forest model will terminate the iteration;

[0019] S5, model training: input the test data into the trained model to obtain the test results. According to the decrease of the error value after each iteration, the corresponding weight is assigned to each random forest output result. The weight value ω m The calculation formula is as follows:

[0020] D m =(RMSE m-1 -RMSE m ) / RMSE m-1 ,

[0021]

[0022] ω m =θ1D m / D+θ2,

[0023] Where m = 2, 3, ..., itr, itr is the number of iterations; D m is the decrease of the error value after the mth iteration; D is D m The sum of mis the weight value of the output result of the mth iteration, where ω1=1 because there is no error gradient when m=1; θ1 and θ2 are adjustment coefficients;

[0024] S6, weighted accumulation of prediction results: The final prediction result of the model is the weighted accumulation of each random forest prediction result. The final prediction result calculation formula of the fitted residual random forest model is:

[0025]

[0026] Where S m is the prediction result of the mth random forest model; S z is the final prediction result of the fitted residual random forest model.

[0027] Compared with the existing technology, the technical advantages of this case are:

[0028] (1) This method overcomes the limitation of k-means cluster analysis that only shortwave radiation flux is considered in the cluster analysis, without considering the influence of other meteorological factors and historical power on the prediction results. By calculating the MIE comprehensive similarity of the main meteorological factors and historical power of each day in each category with the base day, the data that are not similar enough in each category are eliminated, thereby obtaining a more accurate clustering result.

[0029] (2) This method establishes a fitted residual random forest model that integrates the random forest algorithm and the fitted residual algorithm. The advantages of this model are:

[0030] ① The random forest algorithm can process high-dimensional data without feature dimensionality reduction, fully exploiting the information in weather forecast features and historical power data of photovoltaic stations to derive the implicit nonlinear relationships.

[0031] ② The fitting residual algorithm has excellent flexibility and versatility. Using the fitting residual algorithm to optimize the random forest model reduces the risk of overfitting and enhances the robustness of the model.

[0032] ③. The final prediction result in the fitting residual algorithm is changed from the accumulation of the prediction results of each iteration to weighted accumulation. That is, according to the decrease in the prediction error value of the model after each iteration, a corresponding weight is assigned to the output result of each random forest, thereby further improving the prediction accuracy of the fitting residual random forest model. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a flow chart of the steps for predicting photovoltaic power in Example 1 of the present application;

[0034] Figure 2This is a comparison chart of the MIE-weighted FRRF model prediction value proposed in Example 2 of this application, the RF model prediction value and the actual power. DETAILED DESCRIPTION

[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.

[0036] Example 1

[0037] Photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm, such as Figure 1 As shown, the specific steps include:

[0038] S1, data preprocessing, feature correlation analysis and feature construction: preprocess the input data including the weather forecast value for 24 hours later, the photovoltaic power at the current moment and the measured meteorological value at the current moment, find outliers; normalize the data; perform correlation analysis based on whether there is linear correlation between features and between features and labels. Based on the correlation analysis results, remove the feature with extremely weak correlation to the label and the feature with weak correlation to the label among the two features with strong linear correlation, and construct new features;

[0039] S2, based on the shortwave radiation flux k-means clustering, use the elbow diagram to determine the optimal number of clusters k: perform k-means clustering based on the shortwave radiation flux on the training set data, and use the following formula to calculate the intra-cluster error variance SSE, and determine the optimal number of clusters k based on the relationship between the intra-cluster error variance SSE and the number of clusters using the elbow diagram.

[0040]

[0041] Where SSE is the within-cluster error variance; C i represents the i-th cluster, i = 1, 2, 3, ..., k; p is C i The shortwave radiation flux of the sample point in m i It is C i The center of mass, C i The average value of the shortwave radiation flux of all sample points in ;

[0042] S3, based on the comprehensive similarity screening of Mutual Information Entropy (MIE), obtains more accurate clustering results: calculates the comprehensive similarity of MIE between each day and the base day, and eliminates data with MIE comprehensive similarity values ​​lower than the mean of 0.85 in each category to obtain more accurate classification results;

[0043] ①. Find the day with the smallest Euclidean distance to each cluster center in the k-type data as the base day for each type;

[0044] ② Set the meteorological factor set F = {T,h,s,sh,c,pr,pp,d,v}, where T represents the temperature at 2 meters, h represents the relative humidity at 2 meters, s represents the shortwave radiation flux, sh represents the sensible heat flux, c represents the cloud cover, pr represents the sea level pressure, pp represents the photovoltaic power of the previous day, d represents the wind direction at 10 meters, and v represents the wind speed at 10 meters;

[0045] ③. MIE correlation coefficient I NM,i,j Calculation: Take 15 minutes as the sampling interval, define the meteorological factor j of each type on the i-th day as vector N i,j =[N i,j,1 ,…,N i,j,96 ], the meteorological factor j on the reference day is the vector M j =[M j,1 ,…,M j,96 ], where i = 1, 2, 3, ..., n, n is the number of days in this category, and j∈F. The MIE correlation coefficient I between the i-th day of each category and the reference day of this category for meteorological factor j is NM,i,j The calculation formula is

[0046]

[0047] In the formula, H(N i,j ), H(M j ) is the self-information entropy, I(N i,j ;M j ) is the mutual information entropy;

[0048] ④, Self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) calculation:

[0049] Select vector N i,j The maximum and minimum values ​​in, that is, max(N i,j ) and min(N i,j ), the interval [max(N i,j ),min(N i,j )] is divided into Λ subintervals with equal intervals, and N is defined λ i,j is the λth fluctuation subinterval, subinterval N λ i,j The marginal probability density of

[0050]

[0051] Where, Λ λ Represents vector N i,jThe elements in fall into the fluctuation subinterval N λ i,j According to the above steps, the marginal probability density P(M κ j ) and the joint probability density P(N λ i,j M κ j On this basis, the self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) value;

[0052]

[0053]

[0054]

[0055] ⑤、Calculate MIE comprehensive similarity: The calculation formula of MIE comprehensive similarity is

[0056]

[0057]

[0058] Where w j is the MIE weight factor of meteorological factor j and photovoltaic power, W is the sum of all weight factors, I NM,i,j is the MIE correlation coefficient of meteorological factor j between the i-th day of each category and the benchmark day of the category, MCS i is the comprehensive similarity between the weather conditions on the i-th day of each category and the weather conditions on the base day of that category;

[0059] S4, builds a fitted residual random forest model: The residuals of the previous random forest are used as training data for the next random forest. Each new random forest is built to reduce the residuals of the previous random forest in the direction of the gradient. Input data, including the 24-hour weather forecast, the current photovoltaic power, and the current measured meteorological data, is preprocessed and feature constructed. The fitted residual random forest prediction model is then trained. Learning curves and grid search are used to fine-tune the hyperparameters of each random forest model iteration, including the number of trees, maximum tree depth, minimum number of leaf samples, minimum number of samples required for splitting, and maximum number of features in the feature subset. The fitted residual random forest model terminates when the prediction error of the new random forest model decreases below a set threshold compared to the prediction error of the previous random forest model. Finally, the test data is fed into the trained set of random forest models to obtain prediction results.

[0060] S5, model training: input the test data into the trained model to obtain the test results. According to the decrease of the error value after each iteration, the corresponding weight is assigned to each random forest output result. The weight value ω m The calculation formula is as follows:

[0061] D m =(RMSE m-1 -RMSE m ) / RMSE m-1 ,

[0062]

[0063] ω m =θ1D m / D+θ2,

[0064] Where m = 2, 3, ..., itr, itr is the number of iterations; D m is the decrease of the error value after the mth iteration; D is D m The sum of m is the weight value of the output result of the mth iteration, where ω1=1 because there is no error gradient when m=1; θ1 and θ2 are adjustment coefficients.

[0065] S6, weighted accumulation of prediction results: The final prediction result of the model is the weighted accumulation of each random forest prediction result. The final prediction result calculation formula of the fitted residual random forest model is:

[0066]

[0067] Among them, S m is the prediction result of the mth random forest model, S z is the final prediction result of the fitted residual random forest model.

[0068] Example 2

[0069] The data in this example comes from the dataset of the State Grid Control Artificial Intelligence Innovation Competition in September 2021. The selected photovoltaic power station has a rated capacity of 130MW, and includes historical output data for 2019 and 2020, measured meteorological data (6 features), and weather forecast data (22 features). The time step is 15 minutes. The weather forecast data used is the weather forecast data for one day after the first report is 24 hours.

[0070] A photovoltaic probability prediction method based on improved cluster analysis and fusion integration algorithm specifically includes the following steps:

[0071] S1, data preprocessing, feature correlation analysis and feature construction:

[0072] ① Data preprocessing

[0073] The actual power-irradiance joint curve was used to test for outliers in the actual power, identifying data offset points and abnormal zero-value power. A box plot was used to test for outliers in the meteorological values, using the quartile method. Values ​​less than Q1-1.5IQR or greater than Q3+1.5IQR were defined as outliers, where Q1 is the upper quartile, Q2 is the median, Q3 is the lower quartile, and IQR is the interquartile range. Newton interpolation was used for a small number of missing values ​​or outliers, as shown in formula (1). Large numbers were directly deleted. Cloud cover values ​​greater than 100 were assigned a value of 100, while those less than 0 were assigned a value of 0. Values ​​with relative humidity greater than 100 were interpolated using the average of the preceding and following values.

[0074]

[0075] In the formula, x0 is the value of the 0th point, x1 is the value of the 1st point, and x n-1 is the value of the n-1th point, x n is the value of the nth point, and f[x0,x1] is the difference quotient of x0 and x1.

[0076] ②Data normalization

[0077] ③ Feature Correlation Analysis

[0078] Use the scatter plot to preliminarily determine whether there is a linear correlation between features and between features and labels. If there is, the Pearson coefficient is used to measure the degree of correlation. If there is no obvious linear correlation, a comprehensive measurement is performed based on the Pearson coefficient and the mutual information method. The Pearson formula is shown in formula (2):

[0079]

[0080] Where r xy is the correlation coefficient, n is the number of samples, x i is the characteristic value of the i-th sample, is the average value of the characteristic quantity of all samples, y i is the actual power of the ith sample, is the actual power average of all samples.

[0081] Based on the correlation analysis results, we removed features with extremely weak correlation to the label and the one with the smaller correlation to the label among two features with strong linear correlation (correlation > 0.95). After comprehensive analysis, we removed a total of seven features: normal direct irradiance, 70-meter wind direction, 100-meter wind direction, 100-meter wind speed, 30-meter temperature, 70-meter wind speed, and convective precipitation.

[0082] ④. Build new features

[0083] Feature construction can provide more useful information to the model to solve the problem of insufficient model explanatory power. This application uses three methods: feature extraction, feature intersection, and first-order difference to construct new features.

[0084] A comparative test was conducted on the new features. According to the degree of contribution to the model, this application constructed 13 new features: month, day, hour, sea level pressure*2-meter relative humidity, total irradiance*temperature, hour*day, month*day, month*hour, first-order difference of shortwave radiation, first-order difference of 10-meter wind speed, first-order difference of 2-meter temperature, first-order difference of total precipitation, and first-order difference of 2-meter relative humidity.

[0085] S2, based on the k-means clustering of shortwave radiation flux, the optimal number of clusters k is determined using the elbow graph:

[0086] The data sample consists of 686 days of data, which are divided into training and test sets of 617 days and 69 days, respectively. The training set is further divided into training data and validation data, with training data accounting for 70% of the training set and validation data accounting for 30%. The training set data is clustered based on the weather forecast characteristic shortwave radiation flux, and the intra-cluster error variance (SSE) is calculated using formula (3). According to the elbow plot of the relationship between the intra-cluster error variance and the number of clusters, it can be determined that the optimal number of clusters k for the data is 4, and the four categories have 143 days, 164 days, 149 days, and 161 days of data, respectively. The random forest model is trained using the four categories of data. By comparing the shortwave radiation flux of each day in the test set with the Euclidean distance of the four cluster centers, the 69-day test set is also divided into four categories and input into four random forest models to obtain the prediction results. The RMSE test error value is shown in the first row of Table 1.

[0087]

[0088] Where SSE is the within-cluster error variance; C i represents the i-th cluster, i = 1, 2, 3, ..., k; p is C i The shortwave radiation flux of the sample in m i It is C i The center of mass, C i The average shortwave radiation flux of all samples in .

[0089] S3, based on Mutual Information Entropy (MIE) comprehensive similarity screening, obtains more accurate clustering results:

[0090] The k-means clustering based on shortwave radiation flux does not consider the impact of other meteorological factors and historical power on the prediction results. The obtained results may not be optimal and there may be data with inaccurate classification. This embodiment uses MIE comprehensive similarity screening to eliminate data with a similarity lower than 0.85 in each category. The specific steps are as follows:

[0091] ①. Find the base date for each category: Compare the Euclidean distance of the 96 shortwave radiation flux values ​​of each day in the four categories with the cluster center of that category, and find the day closest to the cluster center as the base date. Category 0 is August 20, 2019, Category 1 is November 21, 2019, Category 2 is June 7, 2020, and Category 3 is October 7, 2020.

[0092] ② Select meteorological factors: Set the meteorological factor set F = {T, h, s, sh, c, pr, pp, d, v}, where T represents the temperature at 2 meters, h represents the relative humidity at 2 meters, s represents the shortwave radiation flux, sh represents the sensible heat flux, c represents the cloud cover, pr represents the sea level pressure, pp represents the photovoltaic power of the previous day, d represents the wind direction at 10 meters, and v represents the wind speed at 10 meters;

[0093] ③. MIE correlation coefficient I NM,i,j Calculation (taking category 1 as an example): Take 15 minutes as the sampling interval and define the meteorological factor j on the i-th day in category 1 as vector N i,j =[N i,j,1 ,…,N i,j,96 ], the meteorological factor j on the reference day is the vector M j =[M j,1 ,…,M j,96 ], where i = 1, 2, 3, ..., 164, 164 is the number of days in category 1, j∈F. The MIE correlation coefficient I between the i-th day of category 1 and the benchmark day of the category with respect to meteorological factor j is NM,i,j The calculation formula is

[0094]

[0095] In the formula, H(N i,j ), H(M j ) is the self-information entropy, I(N i,j ;M j ) is the mutual information entropy.

[0096] ④, Self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) calculation:

[0097] Select vector N i,jThe maximum and minimum values ​​in, that is, max(N i,j ) and min(N i,j ), the interval [max(N i,j ),min(N i,j )] is divided into Λ subintervals with equal intervals, and N is defined λ i,j is the λth fluctuation subinterval, subinterval N λ i,j The marginal probability density of

[0098]

[0099] Where, Λ λ Represents vector N i,j The elements in fall into the fluctuation subinterval N λ i,j According to the above steps, the marginal probability density P(M κ j ) and the joint probability density P(N λ i,j M κ j On this basis, the self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) value;

[0100]

[0101]

[0102]

[0103] ⑤、Calculation of MIE comprehensive similarity: Using formulas (12) and (13), calculate the MIE comprehensive similarity value of each type of day

[0104]

[0105]

[0106] Where w j is the MIE weight factor of meteorological factor j and photovoltaic power, W is the sum of all weight factors, I NM,i,j is the MIE correlation coefficient of meteorological factor j between the i-th day of each category and the benchmark day of the category, MCS i is the comprehensive similarity between the weather conditions on the i-th day of each category and the weather conditions on the benchmark day of that category;

[0107] ⑥. Eliminate data within each category where the MIE comprehensive similarity value falls below the mean of 0.85. In this example, 23 days of data were eliminated from the 617 days of data across the four categories. Retrain the random forest model using the new data, and input the four categories of test data, reclassified based on comparison with the new centroids, into each of the four models to obtain prediction results. The RMSE test error values ​​are shown in the second row of Table 1. Compared to the case without MIE comprehensive similarity screening, the overall RMSE test error decreased by 2.0%.

[0108] S4, build the fitted residual random forest model:

[0109] A fitted residual random forest prediction model was established, integrating a random forest algorithm with a fitted residual algorithm. The residuals of the previous random forest are used as training data for the next random forest. Each new random forest is established to reduce the residuals of the previous random forest in the direction of the gradient. This model, used for photovoltaic station power prediction, fully exploits the information in multidimensional features and derives the complex nonlinear relationship between photovoltaic power and meteorological factors implicit in the data. This effectively reduces the risk of overfitting and improves the accuracy of photovoltaic power prediction at the station.

[0110] When the test error of the new random forest model decreases by less than 0.7% compared to the test error of the previous random forest model, the fitted residual random forest model will terminate its iteration. Ultimately, five iterations were performed for the class 0 data, nine iterations for the class 1 data, five iterations for the class 2 data, and six iterations for the class 3 data. The test data was fed into the four FRRF models, and the resulting RMSE test error values ​​are shown in the third row of Table 1. Compared to the single random forest model, the overall RMSE test error value decreased by 3.9%.

[0111] S5, model training: Input the test data into the trained model to obtain the test results. According to the decrease in the error value after each iteration, the corresponding weight is assigned to each random forest output result:

[0112] S6, weighted accumulation of prediction results (MIE-weighted FRRF):

[0113] Improve the fitting residual algorithm, assign corresponding weights to each random forest output according to the decrease in the prediction error value after each iteration, and the final prediction result is the weighted accumulation of the output results of each iteration. The weight value calculation formula is as follows:

[0114] D m =(RMSE m-1 -RMSE m ) / RMSE m-1 (11)

[0115]

[0116] ω m =θ1D m / D+θ2 (13)

[0117]

[0118] Where m = 2, 3, ..., itr, itr is the number of iterations; D m is the decrease of the error value after the mth iteration; D is D m The sum of m is the weight value of the output result of the mth iteration, where, since there is no error gradient when m=1, ω1=1; θ1 and θ2 are adjustment coefficients; S m is the prediction result of the mth random forest model; S z The final prediction results of the residual random forest model are shown in the fourth row of Table 1. The RMSE test error value after changing the final prediction results to weighted accumulation is shown in the fourth row of Table 1. Compared with the simple accumulation method, the total RMSE test error value decreased by 1.3%.

[0119] The comparison of the RMSE error obtained by the prediction method disclosed in this application and the RMSE error of the random forest model is shown in Table 1.

[0120] Table 1 RMSE error comparison

[0121]

[0122] As can be seen from the above table, the prediction method disclosed in this application has a total RMSE test error value that is 7% lower than that of the random forest model, thereby improving the prediction accuracy of the photovoltaic power of the site.

[0123] Figure 2 In order to select the test data of four days on January 27, November 14, November 26, and December 7, 2019 from the 18-day Category 1 test data, the comparison chart between the predicted values ​​and the actual power obtained by inputting the MIE-weighted FRRF model and the RF model respectively is presented, which intuitively demonstrates the degree of improvement in the prediction accuracy of the MIE-weighted FRRF model.

[0124] It should be noted that the above content merely illustrates the technical idea of ​​the present invention and cannot be used to limit the scope of protection of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications all fall within the scope of protection of the claims of the present invention.

Claims

1. A photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm is characterized by: In the prediction method, the improved k-means cluster analysis method is used to calculate the comprehensive similarity of MIE of each day with the base day, and the data with low similarity are eliminated to obtain a more accurate classification result; By establishing a fitted residual random forest prediction model that integrates the random forest algorithm and the fitted residual algorithm, The residual of the previous random forest is used as the training data for the next random forest. The purpose of establishing each new random forest is to reduce the residual of the previous random forest in the direction of the gradient. When the prediction error of the new random forest model decreases below the set threshold compared with the prediction error of the previous random forest model, the fitting residual random forest model will terminate the iteration. By improving the fitting residual algorithm, a corresponding weight is assigned to each random forest output result according to the decrease in the prediction error value of the random forest model after each iteration. The final prediction result is the weighted accumulation of the output results of the random forest model after each iteration. The specific steps include the following: S1, data preprocessing, feature correlation analysis and feature construction: Preprocess the actual photovoltaic power values ​​and meteorological values ​​to find outliers; perform correlation analysis based on whether there is linear correlation between features and between features and labels. Based on the correlation analysis results, remove the features with extremely weak correlation to the label and the features with strong linear correlation that have less correlation to the label, and construct new features; S2, k-means clustering based on shortwave radiation flux, using elbow plot to determine the optimal number of clusters k: perform k-means clustering based on shortwave radiation flux on the training set data, and calculate the intra-cluster error variance (SSE) using the following formula. Based on the relationship between the intra-cluster error variance (SSE) and the number of clusters, the elbow plot is used to determine the optimal number of clusters k for the data; ; Where SSE is the within-cluster error variance; C i represents the i-th cluster, i=1,2,3,…,k; p is C i The shortwave radiation flux of the sample point in m i It is C i The center of mass, C i The average value of the shortwave radiation flux of all sample points in ; S3, based on MIE comprehensive similarity screening, obtain more accurate clustering results: calculate the comprehensive similarity of MIE for each day and the base day, and eliminate data with similarity below the threshold α in each category to obtain more accurate classification results; S4, establishing a fitted residual random forest model: the model is as follows: the residual of the previous random forest is used as the training data for the next random forest. Each new random forest is established to reduce the residual of the previous random forest in the gradient direction. When the prediction error of the new random forest model decreases below the set threshold compared with the prediction error of the previous random forest model, the fitted residual random forest model will terminate the iteration; S5, model training: input the test data into the trained model to obtain the test results. According to the decrease of the error value after each iteration, the corresponding weight is assigned to each random forest output result. The weight value ω m The calculation formula is as follows: ; ; ; Where m = 2, 3, ..., itr, itr is the number of iterations; D m is the decrease of the error value after the mth iteration; D is D m The sum of m is the weight value of the output result of the mth iteration, where ω1=1 is set because there is no error gradient when m=1; θ1 and θ2 are adjustment coefficients; S6, weighted accumulation of prediction results: The final prediction result of the model is the weighted accumulation of each random forest prediction result. The final prediction result calculation formula of the fitted residual random forest model is: ; Where S m is the prediction result of the mth random forest model, S z is the final prediction result of the fitted residual random forest model.

2. The photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm according to claim 1, characterized in that: In step S1, the actual power-irradiance joint curve is used to check the abnormal value of the actual power value, and the data offset point and abnormal zero power are found; and the box plot is used to check the abnormal value of the meteorological value.

3. The photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm according to claim 2, characterized in that: In step S1, new features are constructed by using feature extraction, feature intersection or first-order difference method.

4. The photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm according to claim 2, characterized in that: In step S1, it is determined whether there is a linear correlation between features and between features and labels. If so, the degree of correlation is measured by the Pearson coefficient, specifically: ; Where r xy is the correlation coefficient, n is the number of samples, x i is the characteristic value of the i-th sample, is the average value of the characteristic quantity of all samples, y i is the actual power of the ith sample, is the actual power average of all samples; If there is no obvious linear correlation, the mutual information method is used to perform comprehensive measurement based on Pearson.

5. The photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm according to claim 2, characterized in that: The step S3 further comprises: S31, find the base date of each category: find the day with the smallest Euclidean distance to each cluster center in the k categories of data as the base date of each category; S32, select meteorological factors: Set the meteorological factor set F = {T, h, s, sh, c, pr, pp, d, v}, where T represents the temperature at 2 meters, h represents the relative humidity at 2 meters, s represents the shortwave radiation flux, sh represents the sensible heat flux, c represents the cloud cover, pr represents the sea level pressure, pp represents the photovoltaic power of the previous day, d represents the wind direction at 10 meters, and v represents the wind speed at 10 meters; S33, MIE correlation coefficient I NM,i ,j Calculation: Take 15 minutes as the sampling interval, define the meteorological factor j of each type on the i-th day as vector N i,j =[N i,j,1 ,…,N i,j,96 ], the meteorological factor j on the reference day is the vector M j =[M j,1 ,…,M j,96 ], where i = 1, 2, 3, ..., n, n is the number of days in this category, j∈F; the MIE correlation coefficient I between the i-th day of each category and the reference day of this category for meteorological factor j NM,i,j The calculation formula is ; In the formula, H(N i,j ), H(M j ) is the self-information entropy, I(N i,j ;M j ) is the mutual information entropy; S34, self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) calculation: Select vector N i,j The maximum and minimum values ​​in, that is, max(N i,j ) and min(N i,j ), the interval [max(N i,j ), min(N i,j )] is divided into Λ subintervals with equal intervals, and Nλi,j is defined as the λth fluctuation subinterval. The marginal probability density of subinterval Nλi,j is ; Where, Λ λ Represents vector N i,j The number of data points whose elements fall into the fluctuation subinterval Nλ i,j; According to the above steps, the marginal probability density P (M κ j ) and the joint probability density P(Nλ i,jM κ j ), on this basis, the self-information entropy H(N i,j ), H(M j ) and mutual information entropy I(N i,j ;M j ) value; ; ; ; S35, calculation of MIE comprehensive similarity: the MIE comprehensive similarity calculation formula is: ; ; Where w j is the MIE weight factor of meteorological factor j and photovoltaic power, W is the sum of all weight factors, I NM,i,j is the MIE correlation coefficient of meteorological factor j between the i-th day of each category and the benchmark day of the category, MCS i is the comprehensive similarity between the weather conditions on the i-th day of each category and the weather conditions on the benchmark day of that category; S36, eliminating data with low similarity: In this step, data with MIE comprehensive similarity values ​​lower than a threshold value α in each category are eliminated to obtain a more accurate classification result.

6. The photovoltaic power prediction method based on improved cluster analysis and fusion integration algorithm according to claim 1, characterized in that: The CART tree is selected as the base model, and the hyperparameters of the random forest model are tuned for each iteration using learning curve and grid search. The parameters include the number of trees, the maximum depth of the tree, the minimum number of samples for leaf nodes, the minimum number of samples required for splitting, and the maximum number of features in the feature subset.