A wind power prediction method and system based on interpretability and model fusion
By combining SHAP value and model fusion technology, the problem of low interpretability and accuracy in wind power power prediction is solved, and high-precision wind power power prediction and result interpretation are achieved, supporting the safe operation of the power system and the reasonable maintenance arrangement of the wind turbine.
Patent Information
- Application Number
- CN202410168203.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-02-05
AI Technical Summary
The existing wind power prediction model cannot provide interpretability analysis and the prediction results are low, so it cannot effectively support the safe operation of the power system and the maintenance arrangement of wind turbines.
Using an interpretability method based on SHAP values combined with Boosting and Bagging model fusion technology, XGBoost, LightGBM and CatBoost models were trained by obtaining numerical weather prediction data and actual wind power measurement data, and the model was optimized using Bayesian automatic parameter adjustment method. Finally, Wind power prediction is performed through the integration of Boosting and Bagging modules.
It improves the accuracy of ultra-short-term prediction of wind power, and provides interpretability of the prediction results through SHAP value interpretation analysis, enhancing the credibility and practicality of the model.
Smart Images

Figure CN118054400B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wind power prediction, and in particular to a wind power prediction method and system based on explainability and model fusion. Background Art
[0002] As wind power technology matures, the scale and capacity of wind power units and grid-connected wind farms continue to expand, and the proportion of wind power in the total power generation of the power system increases year by year. The penetration power of wind farms continues to grow, and the series of problems brought by their connection to the grid to the power system's safe operation and absorption and utilization are becoming increasingly prominent. The accuracy of power prediction for high-proportion wind power access is becoming more and more serious.
[0003] At present, predicting the output power of wind farms is one of the effective means to alleviate the peak load and frequency regulation pressure of power systems and improve the wind power acceptance capacity. At the same time, wind farm developers can also use wind power forecasts to select weather with less wind to reasonably arrange the maintenance of wind turbine equipment, so as to minimize the loss of power generation caused by the inability of wind turbines to generate electricity due to maintenance. The wind power prediction model is also mainly based on the black box model provided by machine learning and deep learning, but it cannot make an interpretable analysis of the prediction results, and the prediction results are of low accuracy. Therefore, it is urgent to provide a wind power prediction solution based on interpretability. Summary of the invention
[0004] The present application provides a wind power prediction method and system based on interpretability and model fusion, so as to at least solve the technical problems that the prior art cannot make interpretable analysis of the prediction results and the prediction results have low accuracy.
[0005] The first embodiment of the present application proposes a wind power prediction method based on explainability and model fusion, the method comprising:
[0006] Obtain numerical weather forecast data for the time to be predicted and wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted;
[0007] The numerical weather forecast data at the time to be predicted and the wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted are respectively input into the pre-trained Boosting module and the Bagging module, and the Boosting module and the Bagging module are respectively optimized and solved to obtain the first wind power initial value and the second wind power initial value at the time to be predicted;
[0008] Determine a wind power forecast value at the time to be predicted according to the first wind power initial value and the second wind power initial value at the time to be predicted;
[0009] The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value;
[0010] The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value.
[0011] Preferably, the measured environmental data include: wind speed, wind direction, temperature, air pressure, and humidity.
[0012] Further, the Boosting module includes: a first XGBoost model, a first LightGBM model and a first CatBoost model;
[0013] The Bagging module includes: a second XGBoost model, a second Lightgbm model and a second Catboost model.
[0014] Furthermore, the training process of the Boosting module includes:
[0015] Acquire numerical weather forecast data at each moment in a historical period, measured values of wind power, and historical measured data at each moment in a first preset time period corresponding to each moment to form sample set data, and divide the sample set data into a training set and a test set;
[0016] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first XGBoost model, the measured value of wind power at each moment in the training set data is used as the output of the first XGBoost model, the scoring function is used as the objective function of the model, and the first XGBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first XGBoost model;
[0017] Inputting the numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment into the initial first XGBoost model, and obtaining the first initial wind power prediction value at each moment output by the initial first XGBoost model;
[0018] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as the input of the first LightGBM model, and the measured value of wind power at each moment in the training set data is used as the output of the first LightGBM model. The least squares loss function is used as the objective function of the model, and the first LightGBM model is trained using the Bayesian automatic parameter adjustment method to obtain the initial first LightGBM model;
[0019] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are input into the initial first LightGBM model to obtain the second wind power initial prediction value at each moment output by the initial first LightGBM model;
[0020] The second wind power initial prediction value at each moment is multiplied by the second proportional coefficient corresponding to each moment, and then the product of the second wind power initial prediction value at each moment and the second proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first CatBoost model, the wind power measured value at each moment in the training set data is used as the output of the first CatBoost model, the square loss function is used as the objective function of the model, and the first CatBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first CatBoost model;
[0021] Use the test set data to verify the initial first XGBoost model, the initial first LightGBM model and the initial first CatBoost model, and then use the Boosting method to fuse the verified XGBoost model, LightGBM model and CatBoost model to obtain a trained Boosting module;
[0022] The historical measured data include: measured wind power values and measured environmental data.
[0023] Furthermore, the training process of the Bagging module includes:
[0024] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are respectively used as the input of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the measured value of wind power at each moment in the training set data is respectively used as the output of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the second XGBoost model, the second Lightgbm model and the second Catboost model are respectively trained by using the Bayesian automatic parameter adjustment method to obtain an initial second XGBoost model, an initial second Lightgbm model and an initial second Catboost model;
[0025] Based on the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient corresponding to each moment, and using the Bagging method, the initial second XGBoost model, the initial second Lightgbm model and the initial second Catboost model are subjected to model fusion processing to obtain an initial Bagging module;
[0026] The initial Bagging module is verified using the test set data to obtain a trained Bagging module.
[0027] Furthermore, the calculation formula of the first proportionality coefficient is as follows:
[0028]
[0029] In the formula, α is the first proportional coefficient, shap meanXgboost is the average value of the shap value of the XGBoost model, train Xgboost The median of the XGBoost model prediction value, y_base Xgboost is the mean of the predicted values of the XGBoost model, train mean is the average value of the wind power measured at each moment within the first preset time period;
[0030] The calculation formula of the second proportional coefficient is as follows:
[0031]
[0032] Where β is the second proportional coefficient, shap meanLightgbm is the average value of the Lightgbm model shap value, train Lightgbm is the median of the predicted value, y_base Lightgbm is the mean of the predicted values of the Lightgbm model.
[0033] Furthermore, the calculation formula of the third proportional coefficient is as follows:
[0034]
[0035] In the formula, γ is the third proportional coefficient, and p is the number of features input into the Bagging module;
[0036] The calculation formula of the fourth proportional coefficient is as follows:
[0037]
[0038] Where λ is the fourth proportional coefficient;
[0039] The calculation formula of the fifth proportional coefficient is as follows:
[0040] μ=1-γ-λ
[0041] Wherein, μ is the fifth proportional coefficient.
[0042] The second embodiment of the present application proposes a wind power prediction system based on explainability and model fusion, including:
[0043] An acquisition module, used to acquire numerical weather forecast data at a time to be predicted and wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted;
[0044] A prediction module, used to input the numerical weather prediction data at the time to be predicted and the wind power measured values and environmental measured data at each time within a first preset time before the time to be predicted into a pre-trained Boosting module and a Bagging module, respectively, and optimize and solve the Boosting module and the Bagging module respectively to obtain the first wind power initial value and the second wind power initial value at the time to be predicted;
[0045] A determination module, configured to determine a predicted wind power value at the time to be predicted based on a first initial wind power value and a second initial wind power value at the time to be predicted;
[0046] The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value;
[0047] The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value.
[0048] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0049] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect of the present application.
[0050] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0051] The present application proposes a wind power prediction method and system based on interpretability and model fusion, wherein the method comprises: obtaining numerical weather prediction data at a time to be predicted and actual wind power values and environmental measured data at each time within a first preset time period before the time to be predicted; inputting the numerical weather prediction data at the time to be predicted and the actual wind power values and environmental measured data at each time within a first preset time period before the time to be predicted into a pre-trained Boosting module and a Bagging module, respectively, and optimizing and solving the Boosting module and the Bagging module respectively, to obtain the first wind power initial value and the second wind power at the time to be predicted. rate initial value; determine the wind power forecast value at the time to be predicted according to the first wind power initial value and the second wind power initial value at the time to be predicted; wherein the Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the wind power measured value, the environmental measured data and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value; the Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the wind power measured value, the environmental measured data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value. The technical solution proposed in this application greatly improves the accuracy of ultra-short-term prediction of wind power.
[0052] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0054] Figure 1A flowchart of a wind power prediction method based on explainability and model fusion provided according to an embodiment of the present application;
[0055] Figure 2 A schematic diagram of model training provided according to an embodiment of the present application;
[0056] Figure 3 A detailed diagram of a wind power prediction method provided according to an embodiment of the present application;
[0057] Figure 4 A comparison diagram of predicted values and actual values provided according to an embodiment of the present application;
[0058] Figure 5 This is a diagram of an ablation experiment provided according to an embodiment of the present application.
[0059] Figure 6 A model comparison experiment diagram provided according to an embodiment of the present application;
[0060] Figure 7 A schematic diagram of prediction results of various comparison models provided according to an embodiment of the present application;
[0061] Figure 8 An explanation diagram-feature importance ranking diagram obtained by using an attribution analysis framework based on SHAP theory according to an embodiment of the present application;
[0062] Fig. 9 An explanation diagram - a positive and negative correlation diagram of feature importance obtained using an attribution analysis framework based on SHAP theory provided according to an embodiment of the present application;
[0063] Fig.10 An explanation diagram obtained by using an attribution analysis framework based on SHAP theory according to an embodiment of the present application - a SHAP value diagram of a single sample;
[0064] Fig.11 An explanation diagram - a partial dependence diagram obtained by using an attribution analysis framework based on the SHAP theory provided according to an embodiment of the present application;
[0065] Fig.12 An explanation diagram obtained by using an attribution analysis framework based on SHAP theory according to an embodiment of the present application - an interaction diagram of multiple variables;
[0066] Fig.13 A structural diagram of a wind power prediction system based on explainability and model fusion provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0067] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0068] The present application proposes a wind power prediction method and system based on interpretability and model fusion, wherein the method comprises: obtaining numerical weather prediction data at a time to be predicted and actual wind power values and environmental measured data at each time within a first preset time period before the time to be predicted; inputting the numerical weather prediction data at the time to be predicted and the actual wind power values and environmental measured data at each time within a first preset time period before the time to be predicted into a pre-trained Boosting module and a Bagging module, respectively, and optimizing and solving the Boosting module and the Bagging module respectively, to obtain the first wind power initial value and the second wind power value at the time to be predicted. rate initial value; determine the wind power forecast value at the time to be predicted according to the first wind power initial value and the second wind power initial value at the time to be predicted; wherein the Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the wind power measured value, the environmental measured data and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value; the Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the wind power measured value, the environmental measured data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value. The technical solution proposed in this application greatly improves the accuracy of ultra-short-term prediction of wind power.
[0069] A wind power prediction method and system based on explainability and model fusion according to an embodiment of the present application will be described below with reference to the accompanying drawings.
[0070] Embodiment 1
[0071] Figure 1 A flow chart of a wind power prediction method based on interpretability and model fusion provided according to an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0072] Step 1: Obtain numerical weather forecast data for a time to be predicted and actual wind power values and environmental measured data for each time within a first preset time period before the time to be predicted.
[0073] In the disclosed embodiment, the measured environmental data include: wind speed, wind direction, temperature, air pressure, and humidity.
[0074] For example, if the time to be predicted is 13:15, then the numerical weather forecast data for 13:15 is obtained, as well as the actual measured value of wind power, wind speed, wind direction, temperature, air pressure, and humidity of the wind farm every 15 minutes within the first preset time period before 13:15.
[0075] Step 2: Input the numerical weather forecast data at the time to be predicted and the measured wind power values and environmental measured data at each time within the first preset time period before the time to be predicted into the pre-trained Boosting module and Bagging module respectively, and optimize and solve the Boosting module and Bagging module respectively to obtain the first wind power initial value and the second wind power initial value at the time to be predicted.
[0076] It should be noted that before inputting into the pre-trained Boosting module and Bagging module, a sliding window data set is constructed, and the constructed historical data features, namely the measured wind power, wind speed, wind direction, temperature, air pressure, and humidity of the wind farm every 15 minutes within the first preset time period, need to be spliced with numerical weather forecast data as the final features, and then input into the pre-trained Boosting module and Bagging module.
[0077] The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value;
[0078] The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value.
[0079] In the disclosed embodiment, the Boosting module includes: a first XGBoost model, a first LightGBM model, and a first CatBoost model;
[0080] The Bagging module includes: a second XGBoost model, a second Lightgbm model and a second Catboost model.
[0081] The training process of the Boosting module includes:
[0082] Acquire numerical weather forecast data at each moment in a historical period, measured values of wind power, and historical measured data at each moment in a first preset time period corresponding to each moment to form sample set data, and divide the sample set data into a training set and a test set;
[0083] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first XGBoost model, the measured value of wind power at each moment in the training set data is used as the output of the first XGBoost model, the scoring function is used as the objective function of the model, and the first XGBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first XGBoost model;
[0084] Inputting the numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment into the initial first XGBoost model, and obtaining the first initial wind power prediction value at each moment output by the initial first XGBoost model;
[0085] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as the input of the first LightGBM model, and the measured value of wind power at each moment in the training set data is used as the output of the first LightGBM model. The least squares loss function is used as the objective function of the model, and the first LightGBM model is trained using the Bayesian automatic parameter adjustment method to obtain the initial first LightGBM model;
[0086] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are input into the initial first LightGBM model to obtain the second wind power initial prediction value at each moment output by the initial first LightGBM model;
[0087] The second wind power initial prediction value at each moment is multiplied by the second proportional coefficient corresponding to each moment, and then the product of the second wind power initial prediction value at each moment and the second proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first CatBoost model, the wind power measured value at each moment in the training set data is used as the output of the first CatBoost model, the square loss function is used as the objective function of the model, and the first CatBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first CatBoost model;
[0088] Use the test set data to verify the initial first XGBoost model, the initial first LightGBM model and the initial first CatBoost model, and then use the Boosting method to fuse the verified XGBoost model, LightGBM model and CatBoost model to obtain a trained Boosting module;
[0089] The historical measured data include: measured wind power values and measured environmental data.
[0090] It should be noted that the calculation formula of the first proportionality coefficient is as follows:
[0091]
[0092] In the formula, α is the first proportional coefficient, shap meanXgboost is the average value of the shap value of the XGBoost model, train Xgboost The median of the XGBoost model prediction value, y_base Xgboost is the mean of the predicted values of the XGBoost model, train mean is the average value of the wind power measured at each moment within the first preset time period;
[0093] The calculation formula of the second proportional coefficient is as follows:
[0094]
[0095] Where β is the second proportional coefficient, shap meanLightgbm is the average value of the shap value of the Lightgbm model, train Lightgbm is the median of the predicted value, y_base Lightgbm is the mean of the predicted values of the Lightgbm model.
[0096] The training process of the Bagging module includes:
[0097] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are respectively used as the input of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the measured value of wind power at each moment in the training set data is respectively used as the output of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the second XGBoost model, the second Lightgbm model and the second Catboost model are respectively trained by using the Bayesian automatic parameter adjustment method to obtain an initial second XGBoost model, an initial second Lightgbm model and an initial second Catboost model;
[0098] Based on the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient corresponding to each moment, and using the Bagging method, the initial second XGBoost model, the initial second Lightgbm model and the initial second Catboost model are subjected to model fusion processing to obtain an initial Bagging module;
[0099] The initial Bagging module is verified using the test set data to obtain a trained Bagging module.
[0100] It should be noted that the calculation formula of the third proportional coefficient is as follows:
[0101]
[0102] In the formula, γ is the third proportional coefficient, and p is the number of features input into the Bagging module;
[0103] The calculation formula of the fourth proportional coefficient is as follows:
[0104]
[0105] Where λ is the fourth proportional coefficient;
[0106] The calculation formula of the fifth proportional coefficient is as follows:
[0107] μ=1-γ-λ
[0108] Wherein, μ is the fifth proportional coefficient.
[0109] Specifically, Figure 2 As shown, (1) the historical operation data of a wind farm is obtained, that is, the actual operating power data of the wind farm every 15 minutes, the historical actual wind speed, wind direction, temperature, air pressure and other data as well as the numerical weather forecast data.
[0110] (2) Construct a sliding window data set. The constructed historical data features need to be spliced with numerical weather forecast data as the final features.
[0111] Specifically, a sliding window dataset is constructed using historical actual power, historical actual wind speed, wind direction, temperature, air pressure, humidity, wind speed 1, wind direction 1 and numerical weather forecast data as features and actual power as a label.
[0112] Construct a time series sliding window data set, and construct the divided training set, validation set, and test set into a sliding window data set. The specific formula is as follows:
[0113] feature[i]=x[i:i+t]
[0114] label[i]=y[i+t:i+t+step]
[0115] Among them, i is the number of the currently generated data, x is the historical data feature, feature is the constructed input feature, label is the constructed input value, y is the initial output value, t is the size of the sliding window, step is the number of predicted future points, t and step are adjustable parameters, that is, the historical data of the previous t time steps are used to predict the next step. The constructed features need to be spliced with numerical weather forecast data as the final features.
[0116] (3) Input the data into the boosting module. The boosting module consists of three models, namely XGBoost, LightGBM, and CatBoost models. The first is the XGBoost model, which takes historical data such as historical power and historical wind speed as well as numerical weather forecast data as input. The output result is multiplied by the coefficient α and input into the LightGBM model as a new feature. Similarly, the output result is multiplied by the coefficient β and output into the Catboost model as a new feature to obtain the prediction result of the Boosting module. In addition, the Bagging module uses XGBoost, Lightgbm, and Catboost models for parallel prediction. The prediction results are weighted and summed to obtain the prediction result of the Bagging module. Finally, the prediction results of the two modules are averaged to obtain the final prediction result.
[0117] (4) The calculation method of coefficients α and β in (3) above is based on the interpretability method of SHAP value. The baseline value is the mean of the fitted values of the target variable in the training set. The SHAP value reflects the contribution of different features to the model under different samples.
[0118] The sum of the shap values of each sample feature = the predicted value of the sample model - the average of all sample predicted values, shap meanThe sum of the differences between the predicted value and the mean value of each sample is divided by n, where n is the number of samples.
[0119]
[0120] y_base xgboost =model_Xgboost.predict(test_x).mean()
[0121] y_base lightgbm =model_Lightgbm.predict(test_x).mean()
[0122] y_base catboost =model_Catboost.predict(test_x).mean()
[0123] train mean =mean(train_y)
[0124] train xgboost =model_Xgboost.predict(train_x).mean()
[0125]
[0126]
[0127] Among them, train Xgboost y_base is the median of the fitted values of the training set when using the XGBoost model, Xgboost is the baseline value calculated by the interpretability method based on SHAP value. The baseline value is the mean of the fitted values of the target variable in the training set, that is, the mean of the predicted values obtained during training. mean is the average value of the true value of the training set, train_y is the label of the training set, test_x is the feature of the test set, and train_x is the feature of the training set. When using the XGBoost model, the median of the fitted value of the training set multiplied by the square of the square difference between the average SHAP value and the baseline value, divided by the average value of the true value of the training set multiplied by the square of the square difference between the average SHAP value and the baseline value, can reflect the prediction of the XGBoost model. In this formula, the average SHAP value is the average contribution of each feature in the model, the denominator reflects the deviation between the true value and the baseline value, and the numerator reflects the deviation between the predicted value and the baseline value. Similarly, train Lightgbm The median of the fitted value of the training set for the LightGBM model, y_base Lightgbmis the baseline value calculated by the interpretability method based on SHAP value. meanXgboost is the average value of SHAP value under XGBoost model. meanLightgbm is the average value of SHAP value under Lightgbm model.
[0128] (5) Input the data into the bagging module, which consists of three models. The XGBoost, LightGBM and CatBoost models are used for parallel prediction. The prediction results are weighted and summed to obtain the prediction results of the bagging module. Finally, the prediction results of the two modules are averaged to obtain the final prediction results. The calculation method of the coefficient is determined by the Shap value of each single model.
[0129] (6) Calculation method of coefficients γ, λ, μ in (5) above
[0130]
[0131]
[0132] μ=1-γ-λ
[0133] Where α, β are the coefficients in step (4), and p is the number of features.
[0134] (7) Take the average of the output of the boosting module and the output of the bagging module as the predicted value.
[0135] (8) Perform iterative model training and adjust parameters until the model converges and the optimal fusion model is obtained.
[0136] (9) Use the optimal model to generate future ultra-short-term power forecast data.
[0137] Step 3: Determine the wind power forecast value at the time to be predicted according to the first wind power initial value and the second wind power initial value at the time to be predicted.
[0138] In the disclosed embodiment, the method further includes: comparing the predicted value with the actual value to obtain a prediction effect evaluation, and performing an interpretability analysis on the prediction result, such as Figure 3 FIG. 1 is a schematic diagram of wind power prediction based on the method of this embodiment. Figure 4 The figure shows the comparison between the predicted value and the actual value.
[0139] In the embodiments of the present disclosure, Figure 5As shown, using R2score as the model evaluation criterion, based on the ablation experiment, the prediction effect of the XGBoost single model, the LightGBM single model, the Catboost single model, the model using only the Bagging module, the model using only the Boosting module, and the model R2score values of the solution of the present invention are evaluated, where the calculation formula of R2score is as follows:
[0140]
[0141] Furthermore, we conducted a model comparison experiment and compared it with common classic time series models such as Seq2seq, BiLSTM, Transformer, and ARIMA. The comparison results are as follows: Figure 6 and Figure 7 shown.
[0142] In the embodiment of the present disclosure, the interpretability analysis of the prediction results includes:
[0143] The prediction results are analyzed using the attribution analysis framework based on SHAP theory, and the explanation diagram is as follows:
[0144] ①. Feature Importance Ranking
[0145] The average of the absolute values of the influence of a feature on the target variable is taken as the importance of the feature to obtain the feature importance, as shown in the example Figure 8 .
[0146] ②Overall analysis of characteristics
[0147] You can see whether the feature is positively or negatively correlated with the predicted value, such as Fig.10 As shown in the figure, each row represents a feature, and the horizontal axis is the SHAP value. A point represents a sample. The redder the color, the larger the value of the feature itself, and the bluer the color, the smaller the value of the feature itself.
[0148] ③SHAP value of a single sample
[0149] You can view the predicted value of any sample and the impact of its features on the predicted value.
[0150] like Fig. 9 ,Blue indicates that the contribution of the feature is negative, and red indicates that the contribution of the feature is positive.
[0151] ④ Partial dependence diagram
[0152] SHAP also provides the function of partial dependence graph, the vertical axis is the SHAP value, such as Fig.11 .
[0153] ⑤Interaction diagram of multiple variables
[0154] SHAP also provides interaction plots for multiple variables, such as Fig.12 .
[0155] Experimental analysis:
[0156] From the ablation experiment comparison chart, the R2score values of XGBoost single model, LightGBM single model, Catboost single model, using only Bagging module, using only Boosting module and the solution of the present invention are compared. It can be seen from the figure that the R2score of XGBoost single model is 0.79, the R2score of LightGBM single model is 0.80, the R2score of Catboost single model is 0.78, the R2score of using only Bagging module is 0.81, the R2score of using only Boosting module is 0.82, and the R2score of the solution of the present invention is 0.85. It can be seen that XGBoost single model, LightGBM single model, and Catboost single model all perform well on the test set. Using only Bagging module and using only Boosting module are better than using any single model. The present invention combines Bagging module and Boosting module, which is better than other methods, proving the superiority of model fusion.
[0157] From the model comparison experiment, the R2score of the Seq2seq model is 0.82, the R2score of the BiLSTM model is 0.81, the R2score of the Transformer model is 0.79, the R2score of the ARIMA model is 0.78, and the R2score of the solution of the present invention is 0.85. It can be seen that the prediction result of the ARIMA model is the worst. It is speculated that this may be because ARIMA can only learn from the historical power sequence and cannot use other useful features. The Transformer model is second. The reason may be that the Transformer model is more suitable for long sequence output and is not sensitive to ultra-short-term time series data. The BiLSTM model and Seq2seq have better prediction effects. The bidirectional LSTM structure and end-to-end network structure are more conducive to the learning of time series data. The prediction result of the present invention is the best. First, the idea of model fusion is used to fuse the ensemble learning killer model. Second, the coefficients are calculated using the SHAP value interpretability method. Combining the advantages of interpretability and model fusion, the prediction accuracy is greatly improved.
[0158] From the perspective of model interpretability, Figure 8 This is a feature importance ranking diagram. It can be seen from the figure that the feature wind speed is a very important feature, while wind speed 6 and wind direction 6 are less important features. Fig. 9It can be seen whether the feature is positively correlated or negatively correlated with the predicted value. Each row in the figure represents a feature, and the horizontal axis is the SHAP value. Each row in the figure represents a feature, and the horizontal axis is the SHAP value. A point represents a sample. The redder the color, the larger the value of the feature itself, and the bluer the color, the smaller the value of the feature itself. As can be seen from the figure, most of the wind speed data is positively correlated with power. The larger the value, the larger the SHAP value, while the characteristic humidity is mostly negatively correlated with power, that is, the higher the humidity, the smaller the SHAP value. At the characteristic wind speed 6 and the characteristic wind direction 6, most of the data are concentrated at a SHAP value of 0, indicating that wind speed 6 and wind direction 6 have little effect on the prediction results of the model. Fig.10 , you can view the predicted value of any sample and the impact of its features on the predicted value. Blue means that the contribution of the feature is negative, and red means that the contribution of the feature is positive. As can be seen from the figure, for this sample, the base value is 14.44, and features such as wind speed, temperature 1, and temperature contribute positively to the predicted result, pushing the predicted value to the right, while features such as wind speed 5, wind speed 4, air pressure 1, humidity, air pressure, and wind speed 1 contribute negatively to the predicted result, pushing the predicted value to the left. Since the negative contribution force is greater than the positive contribution force, the final predicted value is less than the base value, which is 5.84. SHAP also provides the function of partial dependence graph, with the ordinate being the SHAP value, such as Fig.11 ,It can be seen from the figure that when the wind speed is low, the SHAP value provided by the wind speed is positively correlated with the wind speed value and changes greatly, while when the wind speed is high, the correlation between the SHAP value provided by the wind speed and the wind speed value becomes lower and the change decreases. SHAP also provides multiple variables for interaction diagrams, such as Fig.12 ,As can be seen from the figure, the correlation between air pressure 1 and temperature 1 is small, while there is some correlation between wind speed and air pressure 1 and wind speed 5. By interpreting the SHAP value graph, the prediction results of the analysis model can be explained from the perspectives of features and individual samples, further improving the interpretability of the model.
[0159] In summary, the wind power prediction method based on interpretability and model fusion proposed in this embodiment, firstly, not only performs rich model fusion on the single model, but also interprets the prediction results in combination with the interpretability method based on SHAP value. Secondly, it not only regards the interpretability method based on SHAP value as an explanatory method, but also participates in the coefficient calculation of model fusion. The present invention combines the respective advantages of interpretability and model fusion in wind power prediction, which greatly improves the accuracy of short-term wind power prediction.
[0160] Embodiment 2
[0161] Fig.13 A structural diagram of a wind power prediction system based on interpretability and model fusion provided according to an embodiment of the present application is shown in FIG. Fig.13 As shown, the system comprises:
[0162] The acquisition module 100 is used to acquire numerical weather forecast data at a time to be predicted and wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted;
[0163] The prediction module 200 is used to input the numerical weather prediction data at the time to be predicted and the wind power measured values and environmental measured data at each time within a first preset time before the time to be predicted into a pre-trained Boosting module and a Bagging module, respectively, and optimize and solve the Boosting module and the Bagging module respectively to obtain the first wind power initial value and the second wind power initial value at the time to be predicted;
[0164] A determination module 300, configured to determine a predicted wind power value at the time to be predicted according to a first initial wind power value and a second initial wind power value at the time to be predicted;
[0165] The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value;
[0166] The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value.
[0167] In the disclosed embodiment, the measured environmental data include: wind speed, wind direction, temperature, air pressure, and humidity.
[0168] It should be noted that the Boosting module includes: a first XGBoost model, a first LightGBM model and a first CatBoost model;
[0169] The Bagging module includes: a second XGBoost model, a second Lightgbm model and a second Catboost model.
[0170] Furthermore, the training process of the Boosting module includes:
[0171] Acquire numerical weather forecast data at each moment in a historical period, measured values of wind power, and historical measured data at each moment in a first preset time period corresponding to each moment to form sample set data, and divide the sample set data into a training set and a test set;
[0172] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first XGBoost model, the measured value of wind power at each moment in the training set data is used as the output of the first XGBoost model, the scoring function is used as the objective function of the model, and the first XGBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first XGBoost model;
[0173] Inputting the numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment into the initial first XGBoost model, and obtaining the first initial wind power prediction value at each moment output by the initial first XGBoost model;
[0174] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as the input of the first LightGBM model, and the measured value of wind power at each moment in the training set data is used as the output of the first LightGBM model. The least squares loss function is used as the objective function of the model, and the first LightGBM model is trained using the Bayesian automatic parameter adjustment method to obtain the initial first LightGBM model;
[0175] The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are input into the initial first LightGBM model to obtain the second wind power initial prediction value at each moment output by the initial first LightGBM model;
[0176] The second wind power initial prediction value at each moment is multiplied by the second proportional coefficient corresponding to each moment, and then the product of the second wind power initial prediction value at each moment and the second proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first CatBoost model, the wind power measured value at each moment in the training set data is used as the output of the first CatBoost model, the square loss function is used as the objective function of the model, and the first CatBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first CatBoost model;
[0177] Use the test set data to verify the initial first XGBoost model, the initial first LightGBM model and the initial first CatBoost model, and then use the Boosting method to fuse the verified XGBoost model, LightGBM model and CatBoost model to obtain a trained Boosting module;
[0178] The historical measured data include: measured wind power values and measured environmental data.
[0179] Furthermore, the training process of the Bagging module includes:
[0180] The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are respectively used as the input of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the measured value of wind power at each moment in the training set data is respectively used as the output of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the second XGBoost model, the second Lightgbm model and the second Catboost model are respectively trained by using the Bayesian automatic parameter adjustment method to obtain an initial second XGBoost model, an initial second Lightgbm model and an initial second Catboost model;
[0181] Based on the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient corresponding to each moment, and using the Bagging method, the initial second XGBoost model, the initial second Lightgbm model and the initial second Catboost model are subjected to model fusion processing to obtain an initial Bagging module;
[0182] The initial Bagging module is verified using the test set data to obtain a trained Bagging module.
[0183] The calculation formula of the first proportionality coefficient is as follows:
[0184]
[0185] In the formula, α is the first proportional coefficient, shap meanXgboost is the average value of the shap value of the XGBoost model, train Xgboost The median of the XGBoost model prediction value, y_base Xgboost is the mean of the predicted values of the XGBoost model, train mean is the average value of the wind power measured at each moment within the first preset time period;
[0186] The calculation formula of the second proportional coefficient is as follows:
[0187]
[0188] Where β is the second proportional coefficient, shap meanLightgbm is the average value of the Lightgbm model shap value, train Lightgbm is the median of the predicted value, y_base Lightgbm is the mean of the predicted values of the Lightgbm model.
[0189] The calculation formula of the third proportional coefficient is as follows:
[0190]
[0191] In the formula, γ is the third proportional coefficient, and p is the number of features input into the Bagging module;
[0192] The calculation formula of the fourth proportional coefficient is as follows:
[0193]
[0194] Where λ is the fourth proportional coefficient;
[0195] The calculation formula of the fifth proportional coefficient is as follows:
[0196] μ=1-γ-λ
[0197] Wherein, μ is the fifth proportional coefficient.
[0198] In summary, the wind power prediction system based on explainability and model fusion proposed in this embodiment greatly improves the accuracy of wind power prediction.
[0199] Embodiment 3
[0200] In order to implement the above embodiments, the present disclosure further proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in Embodiment 1 is implemented.
[0201] Embodiment 4
[0202] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the first embodiment is implemented.
[0203] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0204] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0205] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A wind power prediction method based on interpretability and model fusion, characterized in that: The method comprises: Obtain numerical weather forecast data for the time to be predicted and wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted; The numerical weather forecast data at the time to be predicted and the wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted are respectively input into the pre-trained Boosting module and the Bagging module, and the Boosting module and the Bagging module are respectively optimized and solved to obtain the first wind power initial value and the second wind power initial value at the time to be predicted; Determine a wind power forecast value at the time to be predicted according to the first wind power initial value and the second wind power initial value at the time to be predicted; The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value; The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value; The calculation formula of the first proportionality coefficient is as follows: In the formula, α is the first proportional coefficient, shap meanXgboost is the average value of the shap value of the XGBoost model, train Xgboost The median of the XGBoost model prediction value, y_base Xgboost is the mean of the predicted values of the XGBoost model, train mean is the average value of the wind power measured at each moment within the first preset time period; The calculation formula of the second proportional coefficient is as follows: Where β is the second proportional coefficient, shap meanLightgbm is the average value of the Lightgbm model shap value, train Lightgbm is the median of the predicted value, y_base Lightgbm is the mean of the predicted values of the Lightgbm model; The calculation formula of the third proportional coefficient is as follows: In the formula, γ is the third proportional coefficient, and p is the number of features input into the Bagging module; The calculation formula of the fourth proportional coefficient is as follows: Where λ is the fourth proportional coefficient; The calculation formula of the fifth proportional coefficient is as follows: μ=1-γ-λ Wherein, μ is the fifth proportional coefficient.
2. The method according to claim 1, characterized in that The environmental measured data include: wind speed, wind direction, temperature, air pressure, and humidity.
3. The method according to claim 1, characterized in that The Boosting module includes: a first XGBoost model, a first LightGBM model and a first CatBoost model; The Bagging module includes: a second XGBoost model, a second Lightgbm model and a second Catboost model.
4. The method according to claim 3, characterized in that The training process of the Boosting module includes: Acquire numerical weather forecast data at each moment in a historical period, measured values of wind power, and historical measured data at each moment in a first preset time period corresponding to each moment to form sample set data, and divide the sample set data into a training set and a test set; The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first XGBoost model, the measured value of wind power at each moment in the training set data is used as the output of the first XGBoost model, the scoring function is used as the objective function of the model, and the first XGBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first XGBoost model; Inputting the numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment into the initial first XGBoost model, and obtaining the first initial wind power prediction value at each moment output by the initial first XGBoost model; The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as the input of the first LightGBM model, and the measured value of wind power at each moment in the training set data is used as the output of the first LightGBM model. The least squares loss function is used as the objective function of the model, and the first LightGBM model is trained using the Bayesian automatic parameter adjustment method to obtain the initial first LightGBM model; The first wind power initial prediction value at each moment is multiplied by the first proportional coefficient corresponding to each moment, and then the product of the first wind power initial prediction value at each moment and the first proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are input into the initial first LightGBM model to obtain the second wind power initial prediction value at each moment output by the initial first LightGBM model; The second wind power initial prediction value at each moment is multiplied by the second proportional coefficient corresponding to each moment, and then the product of the second wind power initial prediction value at each moment and the second proportional coefficient corresponding to each moment, the numerical weather forecast data at each moment, and the historical measured data at each moment within the first preset time period corresponding to each moment are used as inputs of the first CatBoost model, the wind power measured value at each moment in the training set data is used as the output of the first CatBoost model, the square loss function is used as the objective function of the model, and the first CatBoost model is trained using the Bayesian automatic parameter adjustment method to obtain an initial first CatBoost model; Use the test set data to verify the initial first XGBoost model, the initial first LightGBM model and the initial first CatBoost model, and then use the Boosting method to fuse the verified XGBoost model, LightGBM model and CatBoost model to obtain a trained Boosting module; The historical measured data include: measured wind power values and measured environmental data.
5. The method according to claim 4, characterized in that The training process of the Bagging module includes: The numerical weather forecast data at each moment in the training set data and the historical measured data at each moment within the first preset time period corresponding to each moment are respectively used as the input of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the measured value of wind power at each moment in the training set data is respectively used as the output of the second XGBoost model, the second Lightgbm model and the second Catboost model, and the second XGBoost model, the second Lightgbm model and the second Catboost model are respectively trained by using the Bayesian automatic parameter adjustment method to obtain an initial second XGBoost model, an initial second Lightgbm model and an initial second Catboost model; Based on the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient corresponding to each moment, and using the Bagging method, the initial second XGBoost model, the initial second Lightgbm model and the initial second Catboost model are subjected to model fusion processing to obtain an initial Bagging module; The initial Bagging module is verified using the test set data to obtain a trained Bagging module.
6. A wind power prediction system based on explainability and model fusion, characterized in that: The system comprises: An acquisition module, used to acquire numerical weather forecast data at a time to be predicted and wind power measured values and environmental measured data at each time within a first preset time period before the time to be predicted; A prediction module, used to input the numerical weather prediction data at the time to be predicted and the wind power measured values and environmental measured data at each time within a first preset time before the time to be predicted into a pre-trained Boosting module and a Bagging module, respectively, and optimize and solve the Boosting module and the Bagging module respectively to obtain the first wind power initial value and the second wind power initial value at the time to be predicted; A determination module, configured to determine a predicted wind power value at the time to be predicted based on a first initial wind power value and a second initial wind power value at the time to be predicted; The Boosting module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data, and the first proportional coefficient and the second proportional coefficient calculated by the interpretability method based on the SHAP value; The Bagging module is trained based on the numerical weather forecast data at each moment in the historical period, the measured value of wind power, the measured environmental data and the third proportional coefficient, the fourth proportional coefficient and the fifth proportional coefficient calculated by the interpretability method based on the SHAP value; The calculation formula of the first proportionality coefficient is as follows: In the formula, α is the first proportional coefficient, shap meanXgboost is the average value of the shap value of the XGBoost model, train Xgboost The median of the XGBoost model prediction value, y_base Xgboost is the mean of the predicted values of the XGBoost model, train mean is the average value of the wind power measured at each moment within the first preset time period; The calculation formula of the second proportional coefficient is as follows: Where β is the second proportional coefficient, shap meanLightgbm is the average value of the Lightgbm model shap value, train Lightgbm is the median of the predicted value, y_base Lightgbm is the mean of the predicted values of the Lightgbm model; The calculation formula of the third proportional coefficient is as follows: In the formula, γ is the third proportional coefficient, and p is the number of features input into the Bagging module; The calculation formula of the fourth proportional coefficient is as follows: Where λ is the fourth proportional coefficient; The calculation formula of the fifth proportional coefficient is as follows: μ=1-γ-λ Wherein, μ is the fifth proportional coefficient.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
