Wind power time sequence prediction method based on SO-XGboost algorithm

By using snake optimization algorithm to optimize the hyperparameters of the XGBoost model in wind power prediction, the problems of poor prediction accuracy and computational efficiency in the prior art are solved, and more efficient and accurate wind power prediction is achieved.

CN119761638APending Publication Date: 2025-04-04LIYANG RES INST OF SOUTHEAST UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411835157.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art cannot fully solve the contradiction between prediction accuracy and computing efficiency in wind power prediction. The input characteristics of a single model are difficult to capture the potential relationship between data. Redundant meteorological data increases the computing burden and reduces the prediction speed.

Method used

The wind power time series prediction method based on the SO-XGboost algorithm is adopted to optimize the hyperparameters of the XGBoost model through the snake optimization algorithm, automatically optimize the parameter settings, reduce the dependence of manual empirical adjustment, and improve computing efficiency and prediction accuracy.

Benefits of technology

It significantly reduces the consumption of time and computing resources, improves the accuracy and calculation speed of wind power prediction, can effectively handle the nonlinear and fluctuation characteristics in wind power data, and improves the fitting and generalization capabilities of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119761638A_ABST
    Figure CN119761638A_ABST
Patent Text Reader

Abstract

The invention discloses a wind power time sequence prediction method based on an SO-XGboost algorithm, and relates to the technical field of wind power plant generation power prediction. The method comprises the following steps: preprocessing wind power data, and dividing a sample data set into a training set and a test set; initializing an XGBoost model and a snake optimization algorithm, optimizing parameters in the XGBoost model by using the snake optimization algorithm, and training the XGBoost model by using the training set to obtain an SO-XGBoost prediction model optimized by the snake optimization algorithm; and inputting the test sample set into the SO-XGBoost prediction model to carry out wind power prediction, and measuring a model prediction effect. According to the method, through constructing and training the improved model, accurate estimation of the wind power generation power is realized, non-linear and fluctuation characteristics in wind power data can be effectively processed, the XGBoost prediction model after parameter optimization has a better prediction effect and prediction precision and has a higher convergence rate, and the generalization ability of the prediction model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wind farm power generation prediction, and in particular to a wind power time series prediction method based on a SO-XGboost algorithm. Background Art

[0002] With the widespread application of renewable energy, wind power has become one of the important energy sources. Existing wind power prediction models can be roughly divided into statistical models and artificial intelligence models. Statistical models have certain limitations and are only applicable to static data analysis. Artificial intelligence models have higher prediction accuracy than statistical models, but their data scale has certain requirements and is prone to overfitting. The timeliness of wind power prediction tasks is easily affected by the complexity of the model. Accurate prediction of wind power is of great significance for power grid dispatching and energy management.

[0003] However, the high nonlinearity and uncertainty of wind farm power generation make prediction extremely challenging. Existing technologies cannot fully solve the contradiction between prediction accuracy and computational efficiency. The input features of a single model are difficult to grasp the potential relationship between data, and redundant meteorological data increases the computational burden of the model and reduces the prediction speed of the model.

[0004] To this end, we designed a wind power time series prediction method based on the SO-XGboost algorithm to solve the above problems. Summary of the invention

[0005] The purpose of the present invention is to solve the contradiction between prediction accuracy and computational efficiency that cannot be fully resolved in the prior art. The input features of a single model are difficult to grasp the potential relationship between data, and redundant meteorological data increases the computational burden of the model, reducing the prediction speed of the model. A wind power time series prediction method based on the SO-XGboost algorithm is proposed, and the parameter setting can be automatically optimized, reducing the dependence on manual experience adjustment, thereby significantly reducing the consumption of time and computing resources. The SO algorithm is essentially a global optimization algorithm, which can effectively find the optimal solution in multidimensional space by simulating the process of snakes looking for food in nature. In the present invention, the SO algorithm is used to optimize the hyperparameters of the XGBoost model. The optimized XGBoost model can better fit the training data, more accurately handle the nonlinear and fluctuating characteristics of wind power, learn the characteristics of the data, and thus achieve more accurate wind power prediction.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A wind power time series prediction method based on SO-XGboost algorithm includes the following steps:

[0008] Step 1: Collect wind power data and perform preprocessing to form a sample data set, and divide the sample data set into a training set and a test set;

[0009] Step 2: Initialize the XGBoost model parameters. The parameters in the XGBoost model include the population size, number of iterations, learning rate, number of base learners, and parameter value range of the maximum tree depth, and initialize the snake optimization algorithm.

[0010] Step 3, using the snake optimization algorithm to optimize the parameters in the XGBoost model, using the training set to train the XGBoost model, and obtaining the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm;

[0011] Step 4: Input the test set into the SO-XGBoost prediction model to predict wind power and measure the prediction effect.

[0012] Further preferably, in step 1, when using the collected wind power data for time series prediction, the wind power data is first normalized and preprocessed, and the normalization standard is the minimum and maximum value normalization method, and the formula is as follows:

[0013]

[0014] Where, P is the wind power data value at the current moment; P min and P max are the minimum and maximum values ​​of wind power in all wind power data respectively; P′ is the normalized result of wind power obtained;

[0015] The wind power data is normalized and preprocessed to form a sample data set, which is divided into a training set and a test set in a ratio of 8:2.

[0016] Further preferably, in step 2, the snake optimization algorithm is initialized: the optimization algorithm process is started by creating a uniformly distributed random population, and the initial population of the snake optimization algorithm adopts the following formula:

[0017] x i =x min +r(x max -x min )

[0018] Among them, x i represents the position of the i-th random population individual, x min and x max Represents the lower and upper limits of the random population, r is a random number, 0≤r≤1;

[0019] The entire snake population is evenly divided into two sub-groups: males and females:

[0020] N f =NN m

[0021] Among them, N represents the population size, N m Refers to the number of male individuals, N f is the number of female individuals.

[0022] Further preferably, in step 3, the process of optimizing the parameters in the XGBoost model using the snake optimization algorithm is as follows:

[0023] The snake optimization algorithm is affected by temperature Temp and food quantity FQ, and is calculated by the following formula:

[0024]

[0025]

[0026] Where T represents the total number of iterations, t represents the current number of iterations, c1 is a constant set to 0.5. When the amount of food FQ is lower than the threshold of 0.25, the snake continues to explore by updating its position. The calculation formula for male snakes is given as:

[0027] x i,m (t+1)=x rand,m (t)±c2×A m ((x max -x min )×rand+x min )

[0028] Among them, x i,m represents the position of the ith male snake, x rand,m represents the position of a random male snake, rand represents a random number between 0 and 1, A m It represents the male's ability to find food, and the calculation formula is:

[0029]

[0030] Among them, f rand,m Represents x rand,m The fitness, f i,m represents the fitness of the ith individual in the male population, c2 is a constant set to 0.05, and ± is a random sign direction operator, indicating scanning the search space in all possible directions; the calculation formula for female snakes is:

[0031] x i,f =x rand,f (g+1)±c2×A f ((x max-x min )×rand×x min )

[0032] Among them, x i,f represents the position of the ith female, x rand,f represents the position of a random female, A f It represents the ability of females to find food, and the calculation formula is as follows:

[0033]

[0034] Among them, f rand,f Represents x rand,f The fitness, f i,f represents the fitness of the i-th individual in the female population.

[0035] The following snake optimization algorithm conditions are used to find the optimal solution for the parameters in the XGBoost model:

[0036] 1) If there is enough food, FQ>0.25, and the temperature is sufficient, Temp>0.6, then the snake only moves to find food:

[0037] x i,j (t+1)=x food ±c3×Temp×rand×(x food -x i,j (t))

[0038] Among them, x i,j Indicates the position of male or female snake, x food represents the best snake position, c3 is a constant equal to 2; Threshold represents the food threshold, and its value is 0.25;

[0039] 2) If the amount of food is sufficient, FQ>0.25, and the temperature is insufficient, Temp<0.6, then the snakes will participate in fighting or mating, and the male F male and female F female The combat mode of an individual is written as:

[0040] x i,m (t+1)=x i,m (t)±c3×F male ×rand×(x best,f -x i,m (t))

[0041] x i,f (t+1)=x i,f (t)±c3×F female ×rand×(x best,m -x i,f (t+1))

[0042] Among them, x best,f represents the position of the best female, x best,m represents the position of the best male, F male and F female Indicates the fighting ability of male and female individuals, F male and F female Calculated based on the following equation:

[0043]

[0044] Among them, f i represents the fitness of the individual, f best,f and f best,f are the fitness of the best individuals in the female and male groups, respectively. The mating patterns of male and female snakes are updated as follows:

[0045] x i,m (t+1)=x i,m (t)±c3×M male ×rand×(FQ×x i,f -x i,m (t))

[0046] x i,f (t+1)=x i,f (t)±c3×M female ×rand×(FQ×x i,m -x i,f (t))

[0047] Among them, M male and M female Represent the mating ability of males and females respectively, and the calculation form is as follows:

[0048]

[0049] If the snake eggs hatch, select the worst male and female individuals and then update

[0050] x worst,m =x min +rand+(x max -x min )

[0051] x worst,f =x min +rand+(x max -x min )

[0052] Among them, x worst,m and x worst,f Represents the worst individuals in both male and female groups;

[0053] According to different temperatures and food, the snakes continuously update their own parameters through the behaviors of searching for food, fighting, and mating, and perform iterative optimization to obtain the optimal parameter combination of the XGBoost model. The XGBoost model is trained using the training set to obtain the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm. The objective function L of the SO-XGBoost prediction model is expressed as follows:

[0054]

[0055] in, represents the loss function, is the wind power forecast value of the target time series at time i, x i is the experimental output of wind power; Ω(f k ) represents the regularization term, f k represents the kth tree in the XGBoost model, μ is the learning rate, M is the number of leaves in the regression tree, λ is the regularization parameter, and w is the leaf weight.

[0056] Further preferably, in step 4, the test set is input into the SO-XGBoost prediction model for wind power prediction, and the prediction effect is measured using the determination coefficient R 2 , mean absolute error MAE, root mean square error RMSE and mean absolute percentage error MAPE are used as the evaluation criteria of the SO-XGBoost prediction model. The calculation formula is as follows:

[0057] (a) Coefficient of determination R 2 :

[0058]

[0059] (b) Mean absolute error (MAE):

[0060]

[0061] (c) Root mean square error RMSE:

[0062]

[0063] (d) Mean absolute percentage error MAPE:

[0064]

[0065] Where n is the number of samples, is the average of all predicted outputs, R 2 The higher the value, the lower the RMSE, MAE, and MAPE values, indicating that the prediction accuracy of the SO-XGBoost prediction model is higher.

[0066] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention uses the snake optimization algorithm to optimize the parameters of the XGBoost model, thereby avoiding falling into the local optimum when searching for the optimal parameters, reducing the reliance on manual experience adjustment, and thus significantly reducing the consumption of time and computing resources. For large-scale training samples, the calculation speed is also improved to a certain extent. The prediction model obtained by using the optimal parameters for wind power time series prediction can effectively handle the nonlinear and fluctuation characteristics in wind power data, overcome the limitations of a single predictor in wind power prediction, and improve the prediction model's ability to fit the complex dynamic characteristics of wind power. It can also have a higher convergence speed while ensuring the prediction accuracy. The prediction model after parameter optimization has better prediction effect and prediction accuracy, and improves the generalization ability of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a flow chart of a wind power time series prediction method based on the SO-XGboost algorithm proposed in the present invention;

[0068] Figure 2 A schematic diagram of the optimization process of the snake optimization algorithm for the wind power time series prediction method based on the SO-XGboost algorithm proposed by the present invention;

[0069] Figure 3 is a fitness value change curve diagram in an embodiment of the present invention;

[0070] Figure 4 This is a training effect diagram in an embodiment of the present invention;

[0071] Figure 5 It is a prediction effect diagram in an embodiment of the present invention;

[0072] Figure 6 This is a diagram showing the error effect of the entire process in an embodiment of the present invention. DETAILED DESCRIPTION

[0073] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0074] When the XGBoost model is used for wind power prediction, the model parameters rely on manual experience adjustment, which consumes a lot of time and computing resources. The good performance of the XGBoost model depends on the appropriate hyperparameter setting, which directly affects the structure of the model and the performance of the model, so it is particularly important to adjust the hyperparameter appropriately. Therefore, the present invention uses the Snake Optimizer (SO) to optimize the parameters of the XGBoost model. The SO algorithm is an innovative meta-heuristic optimization technique inspired by the mating behavior of snakes in the presence of food and low temperature conditions. The algorithm imitates the behavior of snakes during mating and integrates their natural behavior into the optimization process. In the SO algorithm, each snake (male or female) will try its best to find the best partner, that is, the optimal solution, when there is sufficient food and the temperature is low. By introducing the SO algorithm, the parameter setting of the XGBoost model can be automatically optimized, reducing the dependence on manual experience adjustment, thereby significantly reducing the consumption of time and computing resources. In addition, the SO algorithm has a strong global search capability, which can avoid falling into the local optimal solution and improve the prediction performance of the XGBoost model.

[0075] Reference Figure 1 This embodiment proposes a wind power time series prediction method based on the SO-XGboost algorithm, which includes the following steps:

[0076] Step 1: Collect wind power data and perform preprocessing to form a sample data set, and divide the sample data set into a training set and a test set;

[0077] Step 2, initialize the parameters in the XGBoost model, including the population size, number of iterations, learning rate, number of base learners, and parameter value range of the maximum tree depth, and initialize the snake optimization algorithm;

[0078] Step 3, using the snake optimization algorithm to optimize the parameters in the XGBoost model, using the training set to train the XGBoost model, and obtaining the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm;

[0079] Step 4: Input the test set into the SO-XGBoost prediction model to predict wind power and measure the prediction effect.

[0080] In step 1, when using the collected wind power data for time series forecasting, the wind power data is first normalized and preprocessed, and the normalization standard is the minimum and maximum value normalization method, and the formula is as follows:

[0081]

[0082] Where, P is the wind power data value at the current moment; Pmin and P max are the minimum and maximum values ​​of wind power in all wind power data respectively; P′ is the normalized result of wind power obtained;

[0083] The wind power data is normalized and preprocessed to form a sample data set, which is divided into two sets: a training set and a test set in a ratio of 8:2.

[0084] In step 2, initialize the snake optimization algorithm: The snake optimization algorithm starts the optimization process by creating a uniformly distributed random population. The initial population of the snake optimization algorithm uses the following formula:

[0085] x i =x min +r(x max -x min )

[0086] Among them, x i represents the position of the i-th random population individual, x min and x max Represents the lower and upper limits of the random population, r is a random number, 0≤r≤1;

[0087] The entire snake population is evenly divided into two sub-groups: males and females:

[0088] N f =NN m

[0089] Among them, N represents the population size, N m Refers to the number of male individuals, N f is the number of female individuals.

[0090] In step 3, although the XGBoost model can be optimized by manual parameter adjustment, the adjustable parameter range is limited and the efficiency is low. The XGBoost model without parameter optimization has a low fit with the existing data set, resulting in poor generalization performance and adaptability. Therefore, the important parameters of the XGBoost model are iteratively optimized using the snake optimization algorithm to optimize the model parameters and determine the optimal parameter combination process.

[0091] like Figure 2 As shown, the process of finding the best solution for the parameters in the XGBoost model (such as learning rate (learning_rate), number of base learners (n_estimators), maximum tree depth (max_depth), etc.) using the following snake optimization algorithm constraints is as follows:

[0092] The snake optimization algorithm is affected by temperature Temp and food quantity FQ, and is calculated by the following formula:

[0093]

[0094] Where T represents the total number of iterations, t represents the current number of iterations, c1 is a constant set to 0.5. When the amount of food FQ is lower than the threshold of 0.25, the snake continues to explore by updating its position. The calculation formula for male snakes is given as:

[0095] x i,m (t+1)=x rand,m (t)±c2×A m ((x max -x min )×rand+x min )

[0096] Among them, x i,m represents the position of the ith male snake, x rand,m represents the position of a random male snake, rand represents a random number between 0 and 1, A m It represents the male's ability to find food, and the calculation formula is:

[0097]

[0098] Among them, f rand,m Represents x rand,m The fitness, f i,m represents the fitness of the ith individual in the male population, c2 is a constant set to 0.05, and ± is a random sign direction operator, indicating scanning the search space in all possible directions; the calculation formula for female snakes is:

[0099] x i,f =x rand,f (g+1)±c2×A f ((x max -x min )×rand+x min )

[0100] Among them, x i,f represents the position of the ith female, x rand,f represents the position of a random female, A f It represents the ability of females to find food, and the calculation formula is as follows:

[0101]

[0102] Among them, x rand,f Represents x rand,f The fitness, f i,f represents the fitness of the i-th individual in the female population.

[0103] In the snake algorithm utilization phase, the following snake optimization algorithm conditions are used to find the best solution for the parameters in the XGBoost model:

[0104] 1) If there is enough food, FQ>0.25, and the temperature is sufficient, Temp>0.6, then the snake only moves to find food:

[0105] x i,j (t+1)=x food ±c3×Temo×rand×(x food -x i,j (t))

[0106] Among them, x i,j Indicates the position of male or female snake, x food represents the best snake position, c3 is a constant equal to 2; Threshold represents the food threshold, which is 0.25;

[0107] 2) If the amount of food is sufficient, FQ>0.25, and the temperature is insufficient, Temp<0.6, then the snakes will participate in fighting or mating, and the male F male and female F female The combat mode of an individual is written as:

[0108] x i,m (t+1)=x i,m (t)±c3×F male ×rand×(x best,f -x i,m (t))

[0109] x i,f (t+1)=x i,f (t)±c3×F female ×rand×(x best,m -x i,f (t+1))

[0110] Among them, x best,f represents the position of the best female, x best,m represents the position of the best male, F male and F female Indicates the fighting ability of male and female individuals, F male and F female Calculated based on the following equation:

[0111]

[0112] Among them, f i represents the fitness of the individual, f best,f and f best,mare the fitness of the best individuals in the female and male groups, respectively. The mating patterns of male and female snakes are updated as follows:

[0113] x i,m (t+1)=x i,m (t)±c3×M male ×rand×(FQ×x i,f -x i,m (t))

[0114] x i,f (t+1)=x i,f (t)±c3×M female ×rand×(FQ×x i,m -x i,f (t))

[0115] Among them, M male and M female Represent the mating ability of males and females respectively, and the calculation form is as follows:

[0116]

[0117] If the snake egg hatches, select the worst male and female individuals and then update:

[0118] x worst,m =x min +rand+(x max -x min )

[0119] x worst,f =x min +rand+(x max -x min )

[0120] Among them, x worst,m and x worst,f Represents the worst individuals in both male and female groups;

[0121] According to different temperatures and food, the snakes constantly update their own parameters through the behaviors of searching for food, fighting, and mating, and perform iterative optimization to meet the above constraints and obtain the optimal parameter combination of the XGBoost model. The XGBoost model is trained using the training set to obtain the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm. The objective function L of the SO-XGBoost prediction model is expressed as follows:

[0122]

[0123] in, represents the loss function, is the wind power forecast value of the target time series at time i, x i is the experimental output of wind power; Ω(f k ) represents the regularization term, f k represents the kth tree in the XGBoost model, μ is the learning rate, M is the number of leaves in the regression tree, λ is the regularization parameter, and w is the leaf weight.

[0124] Gradient Boosting stands out for its ability to transform weak learners into strong learners through iterative reinforcement, which can effectively reduce prediction errors by giving more weight to previously misjudged instances. Extreme Gradient Boosting (XGBoost) is also a form of gradient boosted decision trees, which features fast processing and high performance. It gradually integrates weak learners to form stronger learners, and uses gradient descent to expand the set of learners within the model, with the goal of reducing the loss between model iterations. XGBoost is considered superior to traditional gradient boosting methods because it effectively solves the overfitting problem through a compatible regularization function. The residual error of the previous tree is transferred to the new tree, and the new tree is trained to minimize the error of the last iteration. Therefore, XGBoost is considered to be a more advanced algorithm that generates optimized trees using a strong objective function.

[0125] In step 4, the test set is input into the SO-XGBoost prediction model for wind power prediction and the prediction effect of wind power is measured. The commonly used evaluation criteria in prediction tasks are used, that is, the determination coefficient R 2 , mean absolute error MAE, root mean square error RMSE and mean absolute percentage error MAPE are used as the evaluation criteria of the SO-XGBoost prediction model. The calculation formula is as follows:

[0126] (a) Coefficient of determination R 2 :

[0127]

[0128] (b) Mean absolute error (MAE):

[0129]

[0130] (c) Root mean square error RMSE:

[0131]

[0132] (d) Mean absolute percentage error MAPE:

[0133]

[0134] Where n is the number of samples, is the average of all predicted outputs, R 2 The higher the value, the lower the RMSE, MAE, and MAPE values, indicating that the prediction accuracy of the SO-XGBoost prediction model is higher.

[0135] In this embodiment, specific implementation steps and experimental results are further illustrated by examples in combination with actual practice.

[0136] (1) A wind power time series data set of a wind farm in Jiangsu Province was selected. A total of 560 hourly data were collected from 01:00 on September 1, 2022 to 01:00 on December 30, 2022. The wind power sample data in the wind power time series data set were preprocessed and the sample data set was divided into a training set and a test set; the first 80% of the data set was used as the training data set, and the remaining 20% ​​of the data set was used as the test data set.

[0137] (2) Initialize the XGBoost model population size SearchAgents_no = 10; the maximum number of iterations Max_iteration = 20. Initialize the value range of the learning rate learning-rate, the number of base learners n_estimators, and the maximum tree depth max_depth parameters, setting the learning-rate range to (0.01, 1), the n_estimators range to (10, 500), and the max_depth range to (10, 20).

[0138] (3) Use the snake optimization algorithm to optimize the parameters of the XGBoost model. For the specific process, please refer to Figure 2 The optimal parameters of the XGBoost model after optimization by the SO optimization algorithm are shown in Table 1 below:

[0139] Table 1 The best parameter table of the XGBoost model after the parameters are optimized by the SO optimization algorithm

[0140]

[0141] Using R 2 As the individual fitness value, initialize the fitness values ​​of all individuals in the N subgroups. Figure 3 The fitness value change curve of SO optimization algorithm in the process of XGBoost model parameter optimization is shown in Figure 2. The fitness value is 5.1×10 -4 to 5.6×10 -4The curve decreases in a step-like manner, indicating that with the increase in the number of iterations, the algorithm finds a better parameter combination to reduce the fitness value, thereby improving the performance of the prediction model. After obtaining the optimal parameter combination of the XGBoost model, the XGBoost model is trained using the training set to obtain the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm.

[0142] (4) Figure 4 This is a diagram of the training effect of the SO-XGBoost prediction model. The horizontal axis represents the data of the training set, and the vertical axis represents the wind power value.

[0143] Input the test sample set into the trained SO-XGBoost prediction model to predict wind power. Figure 5 This is the prediction effect diagram of the SO-XGBoost prediction model. The horizontal axis represents the data of the prediction set, and the vertical axis represents the wind power value. The histogram represents the actual power value, and the curve represents the power value predicted by the SO-XGBoost prediction model. There are some fluctuations between the actual data and the predicted data. Especially at the peak and trough of power, the prediction line sometimes deviates from the actual line. However, the prediction line generally follows the main trend of the actual line. Therefore, the accuracy and effectiveness of the SO-XGBoost prediction model optimized by the snake optimization algorithm in wind power prediction can be shown.

[0144] (5) Using the coefficient of determination (R 2 ), mean absolute error (MAE), root mean square error (RMSE), mean absolute percentage error (MAPE) and other evaluation indicators measure the model prediction performance, as shown in Table 2 below:

[0145] Table 2. Prediction performance of various evaluation indicators measuring models

[0146]

[0147] Table 2 above shows well the improvement in accuracy of the SO-XGBoost prediction model compared to the traditional XGBoost model.

[0148] Figure 6 This is a diagram showing the error effect of the entire process of the SO-XGBoost prediction model in an embodiment of the present invention. Figure 6 A scatter plot and a best fit line are shown in Figure 1 to evaluate the prediction ability of the SO-XGBoost prediction model. In the scatter plot, the actual wind power values ​​are marked as black dots and the predicted power values ​​are marked as hollow dots. The points are arranged along the diagonal line of y=x, and ideally, if the prediction is completely accurate, all points should fall on this line. The solid line represents the best fit line, which is based on the relationship between the predicted and actual values. Figure 6Two dashed lines are also included, representing the 20% error range above and below the best fit line. If the predicted value falls between these two dashed lines, it can be considered that the prediction result has a relatively high accuracy. Figure 6 It can be observed that many prediction points are very close to or fall on the best fit line, which shows that the prediction results of the SO-XGBoost prediction model are quite consistent with the actual values, indicating the effectiveness of the model in wind power prediction.

[0149] (6) Table 3 shows the comparison between the SO-XGBoost prediction model in this embodiment and the three traditional prediction models of SO-RF, SO-CNN, and SO-LSTM. (7)

[0151] Table 3 Comparison of prediction models

[0152]

[0153] It can be seen that the SO-XGBoost prediction model shows superiority in all indicators and has the highest R 2 The R value of the SO-XGBoost prediction model is 2 The value is as high as 96.006%, which is significantly higher than the three prediction models of SO-RF, SO-LSTM and SO-CNN. In terms of error indicators, the SO-XGBoost prediction model also performs best, with the lowest RMSE, MAE and MAPE values. These results show that the prediction performance of the SO-XGBoost prediction model on this set of data is the most stable and accurate.

[0154] In the present invention, wind power prediction is performed based on time series data, mainly extracting time series features such as time dependence and potential periodic changes in the data, and can effectively process nonlinear characteristics in the time series data.

[0155] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A wind power time series prediction method based on SO-XGboost algorithm, characterized in that: The following steps are involved: Step 1: Collect wind power data and perform preprocessing to form a sample data set, and divide the sample data set into a training set and a test set; Step 2: Initialize the XGBoost model parameters, including the population size, number of iterations, learning rate, number of base learners, and maximum tree depth, and initialize the snake optimization algorithm. Step 3, using the snake optimization algorithm to optimize the parameters in the XGBoost model, using the training set to train the XGBoost model, and obtaining the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm; Step 4: Input the test set into the SO-XGBoost prediction model to predict wind power and measure the prediction effect.

2. A wind power time series prediction method based on SO-XGboost algorithm according to claim 1, characterized in that: In step 1, when using the collected wind power data for time series forecasting, the wind power data is first normalized and preprocessed, and the normalization standard is the minimum and maximum value normalization method, and the formula is as follows: Where, P is the wind power data value at the current moment; P min and P max are the minimum and maximum values ​​of wind power in all wind power data respectively; P is the normalized result of wind power obtained; The wind power data is normalized and preprocessed to form a sample data set, which is divided into a training set and a test set in a ratio of 8:

2.

3. The method for predicting wind power time series based on SO-XGboost algorithm according to claim 1 is characterized in that: In step 2, the snake optimization algorithm is initialized by creating a uniformly distributed random population to start the optimization process. The initial population of the snake optimization algorithm uses the following formula: x i =x min +r(x max -x min ) Among them, x i represents the position of the i-th random population individual, x min and x max Represents the lower and upper limits of the random population, r is a random number, 0≤r≤1; The entire snake population is evenly divided into two sub-groups: males and females: N f =n-n m Among them, N represents the population size, N m Refers to the number of male individuals, N f is the number of female individuals.

4. The method for predicting wind power time series based on SO-XGboost algorithm according to claim 1 is characterized in that: In step 3, the process of optimizing the parameters in the XGBoost model using the snake optimization algorithm is as follows: The snake optimization algorithm is affected by temperature Temp and food quantity FQ, and is calculated by the following formula: Where T represents the total number of iterations, t represents the current number of iterations, c1 is a constant set to 0.

5. When the amount of food FQ is lower than the threshold of 0.25, the snake continues to explore by updating its position. The calculation formula for male snakes is given as: x i,m (t+1)=x rand,m (t)±c2×A m ((x max -x min )×rand+x min ) where x i,m represents the position of the ith male snake, x rand,m represents the position of a random male snake, rand represents a random number between 0 and 1, A m It represents the male's ability to find food, and the calculation formula is: Among them, f rand,m Represents x rand,m The fitness, f i,m represents the fitness of the ith individual in the male population, c2 is a constant set to 0.05, and ± is a random sign direction operator, indicating scanning the search space in all possible directions; the calculation formula for female snakes is: x i,f =x rand,f (g+1)±c2×A f ((x max -x min )×rand+x min ) Among them, x i,f represents the position of the ith female, x rand,f represents the position of a random female, A f It represents the ability of females to find food, and the calculation formula is as follows: Among them, f rand,f Represents x rand,f The fitness, f i,f represents the fitness of the i-th individual in the female population; The following snake optimization algorithm conditions are used to find the optimal solution for the parameters in the XGBoost model: 1) If there is enough food, FQ>0.25, and the temperature is sufficient, Temp>0.6, then the snake only moves to find food: x i,j (t+1)=x food ±c3×Temp×rand×(x food -x i,j (t)) Among them, x i,j Indicates the position of male or female snake, x food represents the best snake position, c3 is a constant equal to 2; Threshold represents the food threshold, and its value is 0.25; 2) If the amount of food is sufficient, FQ>0.25, and the temperature is insufficient, Temp<0.6, then the snakes will participate in fighting or mating, and the male F male and female F female The combat mode of an individual is written as: x i,m (t+1)=x i,m (t)±c3×F male ×rand×(x best,f -x i,m (t)) x i,f (t+1)=x i,f (t)±c3×F female ×rand×(x best,m -x i,f (t+1)) Among them, x best,f represents the position of the best female, x best,m represents the position of the best male, F male and F female Indicates the fighting ability of male and female individuals, F male and F female Calculated based on the following equation: Among them, f i represents the fitness of the individual, f best,f and f best,m are the fitness of the best individuals in the female and male groups, respectively. The mating patterns of male and female snakes are updated as follows: x i,m (t+1)=x i,m (t)±c3×M male ×rand×(FQ×x i,f -x i,m (t)) x i,f (t+1)=x i,f (t)±c3×M female ×rand×(FQ×x i,m -x i,f (t)) Among them, M male and M female Represent the mating ability of males and females respectively, and the calculation form is as follows: If the snake egg hatches, select the worst male and female individuals and update x worst,m =x min +rand+(x max -x min ) x worst,f =x min +rand+(x max -x min ) Among them, x worst,m and x worst,f Represents the worst individuals in both male and female groups; According to different temperatures and food, the snakes constantly update their own parameters through the behaviors of searching for food, fighting, and mating, and perform iterative optimization to obtain the optimal parameter combination of the XGBoost model. The XGBoost model is trained using the training set to obtain the SO-XGBoost prediction model for wind power time series prediction optimized by the snake optimization algorithm. The expression formula of the objective function L of the S0-XGBoost prediction model is as follows: in, represents the loss function, is the wind power forecast value of the target time series at time i, x i is the experimental output of wind power; Ω(f k ) represents the regularization term, f k represents the kth tree in the XGBoost model, μ is the learning rate, M is the number of leaves in the regression tree, λ is the regularization parameter, and w is the leaf weight.

5. The wind power time series prediction method based on S0-XGboost algorithm according to claim 1 is characterized in that: In step 4, the test set is input into the S0-XGBoost prediction model for wind power prediction, and the prediction effect is measured using the determination coefficient R 2 , mean absolute error MAE, root mean square error RMSE and mean absolute percentage error MAPE are used as the evaluation criteria of the S0-XGBoost prediction model. The calculation formula is as follows: (a) Coefficient of determination R 2 : (b) Mean absolute error (MAE): (c) Root mean square error RMSE: (d) Mean absolute percentage error MAPE: Where n is the number of samples, is the average value of all wind power forecast outputs, R 2 The higher the value, the lower the RMSE, MAE, and MAPE values, indicating that the prediction accuracy of the S0-XGBoost prediction model is higher.