A power system load forecasting method based on double-layer XGBoost considering multiple features

Through the double-layer XGBoost algorithm and feature engineering, the problem of insufficient data characteristics in power system load prediction is solved, the prediction accuracy and efficiency are improved, and efficient prediction of power load is achieved.

CN112330050BActive Publication Date: 2025-01-14YINGKOU ELECTRIC POWER SUPPLY COMPANY OF STATE GRID LIAONING ELECTRIC POWER SUPPLY +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011307593.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-20
Publication Date
2025-01-14
Estimated Expiration
2040-11-20

AI Technical Summary

Technical Problem

In the load prediction of power system, the data feature dimensions are fewer, the characteristic relationship is unclear, and the amount of effective data is small, resulting in low accuracy of ultra-short-term load prediction.

Method used

Using the double-layer XGBoost algorithm, select similar load sequences to collect feature data, clean outliers and missing values, establish the first layer XGBoost model to filter out significant influence features, and then build the second layer XGBoost model for prediction, and improve prediction with feature engineering Accuracy and efficiency.

Benefits of technology

It significantly improves the accuracy, speed and generalization ability of load prediction, simplifies the prediction input data set, and comprehensively characterizes the impact of complex factors on power load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112330050B_ABST
    Figure CN112330050B_ABST
Patent Text Reader

Abstract

A method for predicting load of an electric power system based on double-layer XGBoost and considering multiple features, adopting CART tree as a base learner, inputting preprocessed historical load and feature data, constructing multiple weak learners to train layer by layer to obtain a model and screen the feature set that significantly affects the load. In the second-layer model training process, K-fold cross-validation is introduced to divide the data into training sets and test sets to avoid the impact on the model hyperparameters, and finally the test set features are input into the model to obtain the final prediction results. The advantages of the present invention are: it can avoid standardization of data features, process data with missing fields, does not need to worry about whether the features are interdependent, and has a good model learning effect; it provides a new prediction method for accurate prediction of load in an electric power system, can ensure the safe and stable operation of the electric power system, ensure the reliability of power supply, and improve social and economic benefits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system load forecasting, and in particular to a load forecasting method based on double-layer XGBoost considering multiple features. Background Art

[0002] Power load forecasting is the process of exploring the patterns between historical data and future load changes based on historical data such as power load, economy and meteorology. Theoretically, power load forecasting is the process of seeking the intrinsic relationship between power load and various external factors, so as to make reasonable predictions on future loads.

[0003] Based on the historical load data of the power grid, and taking into account the influencing factors such as electricity prices, weather, holidays, etc., the power load in a certain period of time in the future can be accurately predicted in the ultra-short term. It can ensure the reliability of power supply; improve social and economic benefits; provide an important basis for the formulation of power grid dispatching and maintenance plans; save power generation resources and maintain safe and stable operation of the power grid.

[0004] In view of the common characteristics of the current power system load forecasting, such as fewer feature dimensions of the collected data, unclear feature relationships, and less effective data volume, in order to improve the accuracy of ultra-short-term load forecasting of the power grid, an ultra-short-term power load forecasting method based on a double-layer XGBoost algorithm fusing multiple features was proposed. Summary of the invention

[0005] At present, the power system load forecasting generally has the characteristics of few feature dimensions of the collected data, unclear feature relationships, and small amount of effective data.

[0006] The purpose of the present invention is to provide a method for load forecasting of a power system based on feature engineering, which significantly improves the accuracy, speed and generalization ability of load forecasting under machine learning. To achieve the above purpose, the following scheme is adopted. The method of the present invention includes the following steps:

[0007] S1 selects n similar load sequences before the forecast date; the sampling points for each date are 96 points, that is, sampling once every 15 minutes;

[0008] S2 collects and selects characteristic data of n similar types of dates, including time, weather, date type, etc.;

[0009] S3 cleans the data to remove outliers, missing values, and other noise data from historical loads and feature data sets of similar types;

[0010] S4 establishes the first-level XGBoost model that considers complex influencing factors; obtains model parameters, prediction results, and feature correlation rankings;

[0011] S5 divides the data into blocks based on cross-validation; it is divided into a test set and a validation set;

[0012] S6 constructs a second-layer XGBoost prediction model, takes the extracted feature vectors and historical load data as input for prediction training, and predicts the load value of 15min granularity on the n+1th day through a double-layer XGBoost prediction method.

[0013] S7 calculates the prediction accuracy.

[0014] The relevant load impact feature data set in S2 includes time X0, precipitation X1, air pressure X2, maximum air pressure X3, minimum air pressure X4, temperature X5, maximum temperature X6, minimum temperature X7, relative humidity X8, minimum relative humidity X9, ground temperature X10, maximum ground temperature X11, minimum ground temperature X12, current weather X13, load of nearby transformer in the previous period X14, wind direction X15, wind speed X16, temperature in the previous period X17, load in the previous period X18, date type X19. The above feature data and corresponding historical load data will be used as the first-layer XGBoost prediction model data input.

[0015] In the S3 data cleaning, the specific method of selecting the historical load of similar days and the outlier detection principle of the feature data set is as follows:

[0016] Numerical attributes detect outliers directly through numerical operations; outliers are objects that deviate significantly from other data points in the data of each feature. For numerical data, there will be values ​​that differ greatly from before and after. The 3σ principle is used to calculate the quartiles of the data: the first quartile (Q1) and the third quartile (Q3), and the acceptable value range is set as:

[0017] Q3+k(Q3-Q1)~Q1-k(Q3-Q1) (12)

[0018] Values ​​outside the above range are considered outliers.

[0019] Ordinal data has a range of values, and outlier detection removes values ​​outside the range as outliers;

[0020] For nominal data, outlier detection is similar to ordinal data, with a specific set of values. Missing value processing can be performed after all outliers are removed.

[0021] In the S3 data cleaning, the specific method of selecting the missing value filling principle in the historical load and feature data set of similar types of days is as follows:

[0022] For ordinal data, the data is directly filled in order; for nominal data, seasonal factors are taken into consideration and the majority is taken after deleting null values ​​in this month.

[0023] The specific method of the XGBoost algorithm principle in S4 is as follows:

[0024] Using CART tree as the base learner, by constructing multiple weak learners, the model is trained by reducing the loss along the direction of the steepest gradient in each iterative learning, and efforts are made to correct the residuals of all previous weak learners. Finally, the weighted summation is used to obtain the final prediction result, namely:

[0025]

[0026] Assuming that the given sample set has n samples and m features, then:

[0027] D = {x i ,y i}(|D|=n,x i ∈R m ,y i ∈R) (2)

[0028] Among them, x i represents i samples, y i Represents the i-th category label, the space F of the CART tree is:

[0029] F={f(x)=ω q(x)}(q:R m →T,ω∈R T ) (3)

[0030] Among them, q represents the structure of each tree, which maps samples to corresponding leaf nodes; T is the structure q of the corresponding tree and the weight ω of the leaf node. Therefore, the prediction value of XGBoost is the sum of the values ​​of the leaf nodes corresponding to each tree. Minimize the following objective function:

[0031]

[0032] in, Represents the predicted value of the model, y i represents the category label of the i-th sample, f k represents the k-th tree model, T represents the number of leaf nodes of each tree, ω represents the set of scores of the leaf nodes of each tree, γ and λ represent coefficients, which need to be adjusted in practical applications.

[0033] The first term in the above formula is the loss error, and the second term is the regularization term, which controls the complexity of the tree and prevents overfitting. The optimization parameter of the objective function is the model (function), which cannot be optimized in Euclidean space using traditional optimization methods. However, when training the model, it can be understood as an addition method. Therefore, in the tth round, f(t) is added to the model to minimize the objective function. The process is as follows:

[0034]

[0035]

[0036]

[0037] ---

[0038]

[0039] During training, a new f function is added in the new round to minimize the objective function. In the tth round, the objective function is:

[0040]

[0041] in,

[0042]

[0043] After solving, the iteration of the tree model is transformed into the iteration of the leaf nodes of the tree, and the optimal leaf node score is calculated. The final objective function is in the form of:

[0044]

[0045] The main purpose of S4 is to provide S6 with model initial parameters and a feature set that significantly affects the load by establishing an XGBoost prediction model that takes into account complex influencing features.

[0046] S403 outputs the prediction results, model parameters and selected features to rank the impact on the load and screen the features that significantly affect the load. The model parameters include Max_depthX1, Learning_rateX2, n_estimatorsX3, min_child_weightX4, subsampleX5, colsample_bytreeX6, gammaX7, reg_alphaX8, reg_lambdaX9, and early_stopping_roundsX10.

[0047] S403 outputs the prediction results, model parameters and selected features to rank the load impact and screen the features that significantly affect the load. The model selects the features that significantly affect the load, including time X0, air pressure X2, air temperature X5, ground temperature X10, nearby transformer load X14, wind direction X15, wind speed X16, and load in the previous period X18.

[0048] In S6, the specific prediction method is as follows:

[0049] The second-layer XGBoost prediction model is constructed, and the extracted feature vectors that significantly affect the load and the historical load data are used as input for prediction training. The load value of the 15-min granularity on the n+1 day is predicted by the double-layer XGBoost prediction method. Finally, the prediction accuracy is calculated and an example analysis is performed.

[0050] Advantages of the present invention:

[0051] Using the 3σ principle, the collected initial feature set and historical load can be cleaned to remove noise data, making the data more effective and concise; using the XGBoost model, the preprocessed feature variables can be sorted by relevance based on feature engineering, and the feature set that significantly affects the load can be screened to improve the accuracy and efficiency of the prediction model; introducing a double-layer XGBoost combined with feature engineering prediction model to extract the feature quantity of factors that significantly affect the load, and use it together with the historical load as the modeling object, so that the established input quantity can not only comprehensively characterize the impact of complex factors on the power load, but also simplify the prediction input data set. The dynamic reference of the initial parameters of the double-layer prediction model significantly improves the accuracy, speed and generalization ability of power load prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments:

[0053] Figure 1 It is a schematic flow diagram of the method of the present invention;

[0054] Figure 2 It is a specific schematic diagram of the process of step S4 of the present invention;

[0055] Figure 3 This is a graph showing the scoring results of 20 characteristic variables using the method of the present invention;

[0056] Figure 4 It is a comparison chart between the predicted load curve and the actual load curve under different methods;

[0057] Figure 5 It is a comparison chart between the predicted load curve and the actual load curve under different indicators. DETAILED DESCRIPTION

[0058] The present invention will be further described below in conjunction with the accompanying drawings:

[0059] like Figure 1 As shown, the ultra-short-term power load forecasting method based on the double-layer XGBoost algorithm integrating multiple features of the present invention comprises the following steps:

[0060] 1) Select n similar load sequences before the forecast date; the sampling points for each date are 96 points, that is, sampling once every 15 minutes;

[0061] 2) Collect and select characteristic data of n similar dates, including time, weather, date type, etc.;

[0062] 3) Clean the data and remove the outliers, missing values ​​and other noise data in the historical load and feature data sets of similar days;

[0063] 4) Establish the first-level XGBoost model that considers complex influencing factors; obtain model parameters, prediction results, and feature correlation rankings;

[0064] 5) Divide the data into test set and validation set based on cross-validation;

[0065] 6) Through the constructed second-layer XGBoost prediction model, the extracted feature vectors and historical load data are used as input for prediction training, and the load value of 15min granularity on the n+1th day is predicted through the double-layer XGBoost prediction method.

[0066] 7) Calculate the prediction accuracy.

[0067] like Figure 2 As shown, the S4 comprises the following steps:

[0068] 1) Initially set the XGBoost model hyperparameters;

[0069] 2) Build the first-layer XGBoost prediction model;

[0070] 3) Output prediction results, model parameters and select features to rank their impact on load; filter out feature sets that significantly affect load.

[0071] like Figure 3As shown, the relevant load impact feature data set in S2 includes time X0, precipitation X1, air pressure X2, maximum air pressure X3, minimum air pressure X4, temperature X5, maximum temperature X6, minimum temperature X7, relative humidity X8, minimum relative humidity X9, ground temperature X10, maximum ground temperature X11, minimum ground temperature X12, current weather X13, load of nearby transformer in the previous period X14, wind direction X15, wind speed X16, temperature in the previous period X17, load in the previous period X18, date type X19. The above feature data and corresponding historical load data will be used as the first-layer XGBoost prediction model data input. According to the model's correlation score for the feature variables to the load, 8 features that significantly affect the load are screened out; the S403 outputs the prediction results, model parameters and selected features to rank the load impact and screen the feature set that significantly affects the load. The model selects features that significantly affect the load, including time X0, air pressure X2, air temperature X5, ground temperature X10, nearby transformer load X14, wind direction X15, wind speed X16, and load in the previous period X18; the model parameters include Max_depthX1, Learning_rateX2, n_estimatorsX3, min_child_weightX4, subsampleX5, colsample_bytreeX6, gammaX7, reg_alphaX8, reg_lambdaX9, and early_stopping_roundsX10.

[0072] Application examples:

[0073] Based on the historical load and local related characteristics of a 10kV transformer in a certain province from June 28, 2020 to August 28, 2020, the measured data is the data recorded by the local meteorological bureau, with a cycle of 15 minutes and 96 groups per day; the historical load data comes from the transformer recorded data, with a time resolution of 15 minutes. There are mainly meteorological factors (temperature, humidity, air pressure, wind speed, wind direction, precipitation, weather conditions, etc.) and non-meteorological factors (time, load of nearby transformers, load in the previous period, whether it is a working day, etc.), totaling 21 dimensions and 5253 data.

[0074] The prediction process follows Figure 1 The flow chart is carried out.

[0075] First, extract the characteristics of factors that affect the load, preprocess them, import them into the first-level XGBoost prediction model, screen 8 significant factors that affect the load, and store the training model and parameters. The selected data set is used as the input data set for the final model training, and the parameters of the first-level prediction model are used as the initial parameters. The data set is divided based on cross-validation to establish a training set and a test set. The training set and the test set have common attributes. The training set adds the training target load value, and the test set only contains the feature set. Train on the training set and predict the test set. During the training process, the model is gradually fine-tuned by comparing the output results.

[0076] Based on the first-layer XGBoost (XGB_1) prediction model, the relevance of each feature is sorted, and the parameters and prediction results are output. The feature relevance is sorted as follows: Figure 3 , select 8 features that significantly affect the load. The selected features are: time, air pressure, air temperature, ground temperature, load of the adjacent transformer in the previous period, wind direction, wind speed, and load in the previous period. Figure 4 The prediction results of one-layer XGBoost (XGB_1), BP neural network and double-layer XGBoost (this method, XGB_2) on August 1 are compared with the actual load. The prediction accuracy of this method (XGB_2) is 98.28%.

[0077] From a comprehensive comparison, the method in this paper has certain advantages over the other two prediction methods in terms of prediction accuracy and training time.

[0078] This method is applied to the load and influencing factor indicators of the transformer from September 29, 2019 to November 2, 2019. The prediction comparison results on November 1 are as follows: Figure 5 ,It can be seen that this method has good generalization ability and ,strong adaptability.

[0079] The present invention is not limited to the above-mentioned embodiments. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention. The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

Claims

1. A method for power system load forecasting based on double-layer XGBoost considering multiple features, characterized in that: The power system load forecasting method based on double-layer XGBoost considering multiple features The following steps are involved: S1, select n similar load sequences before the forecast date; the sampling points for each date are 96 points, that is, sampling once every 15 minutes; S2, collect and select characteristic data of n similar types of dates, including time, weather, and date type; S3, data cleaning, removing the noise data of abnormal values ​​and missing values ​​in the historical load and feature data sets of similar types of days; S4, establish the first-level XGBoost model that considers complex influencing factors; obtain model parameters, prediction results and feature correlation rankings; S5, divide the data into test set and validation set based on cross-validation; S6, through the constructed second-layer XGBoost prediction model, the extracted feature vector and historical load data are used as input for prediction training, and the load value of 15min granularity on the n+1th day is predicted by the double-layer XGBoost prediction method; S7, calculate prediction accuracy; The steps of S4 to establish the first layer of XGBoost model considering complex influencing factors include: S401, initial setting of XGBoost model hyperparameters; S402, constructing the first layer of XGBoost prediction model; The relevant load impact feature set includes time X0, precipitation X1, air pressure X2, maximum air pressure X3, minimum air pressure X4, temperature X5, maximum temperature X6, minimum temperature X7, relative humidity X8, minimum relative humidity X9, ground temperature X10, maximum ground temperature X11, minimum ground temperature X12, current weather X13, nearby transformer load X14, wind direction X15, wind speed X16, temperature in the previous period X17, load in the previous period X18, date type X19. The above feature data and corresponding historical load data will be used as the first-layer XGBoost prediction model data input; In S4, the steps for establishing the first-level XGBoost model that considers complex influencing factors are as follows: S403, outputting the prediction results, model parameters and the ranking of the influence of selected features on the load; screening the feature set that significantly influences the load; Output the prediction results and calculate the accuracy, output the model parameters as the initial parameters of the second-layer prediction model, and select the feature set that significantly affects the load according to the correlation of the features to the load impact; The specific method of the XGBoost algorithm principle in S4 is as follows: Using CART tree as the base learner, by constructing multiple weak learners, the model is trained by reducing the loss along the direction of the steepest gradient in each iterative learning, and efforts are made to correct the residuals of all previous weak learners. Finally, the weighted summation is used to obtain the final prediction result, namely: Assuming that the given sample set has n samples and m features, then: D={x i ,y i }(|D|=n,x i ∈R m ,y i ∈R) (2) Among them, x i represents i samples, y i Represents the i-th category label, the space F of the CART tree is: F={f(x)=ω q(x) }(q:R m →T,ω∈R T ) (3) Among them, q represents the structure of each tree, which maps samples to corresponding leaf nodes; T is the structure q of the corresponding tree and the weight ω of the leaf node; so the prediction value of XGBoost is the sum of the values ​​of the leaf nodes corresponding to each tree; minimize the following objective function: in, Represents the predicted value of the model, y i represents the category label of the i-th sample, f k represents the k-th tree model, T represents the number of leaf nodes in each tree, ω represents the set of scores of leaf nodes in each tree, γ and λ represent coefficients, which need to be adjusted in practical applications; The first term in the above formula is the loss error, and the second term is the regularization term, which controls the complexity of the tree and prevents overfitting. The optimization parameter of the objective function is the model (function), which cannot be optimized in Euclidean space using traditional optimization methods. However, when training the model, it can be understood as an addition method. Therefore, in the tth round, f(t) is added to the model to minimize the objective function. The process is as follows: --- During training, a new f function is added in the new round to minimize the objective function. In the tth round, the objective function is: in, After solving, the iteration of the tree model is transformed into the iteration of the leaf nodes of the tree, and the optimal leaf node score is calculated. The final objective function is in the form of:

2. According to claim 1, a method for power system load forecasting based on double-layer XGBoost considering multiple features is characterized by: In S3 cleansing data, the specific method of selecting the historical load of similar days and the numerical outlier detection principle in the feature data set is as follows: The outlier detection of numerical attributes can be directly detected through numerical operations; outliers are objects that deviate significantly from other data points in the data of each feature; for numerical data, there will be values ​​that differ greatly from before and after, and the 3σ principle is used to calculate the quartiles of the data: the first quartile (Q1) and the third quartile (Q3), and the acceptable value range is set as: Q3+k(Q3-Q1)~Q1-k(Q3-Q1) (12) Values ​​outside the above range are considered outliers.

3. According to claim 1, a method for power system load forecasting based on double-layer XGBoost considering multiple features is characterized in that: In S3 cleansing data, the specific method of selecting the ordinal and nominal outlier detection principle in the historical load and feature data set of similar types of days is as follows: Ordinal data has a range of values, and outlier detection removes values ​​outside the range as outliers. For nominal data, outlier detection is similar to ordinal data, and has a specific set of values. After removing all outliers, missing value processing can be performed.

4. The method for power system load forecasting based on double-layer XGBoost considering multiple features according to claim 1 is characterized in that: In S3 cleansing data, the specific method for filling missing values ​​in the historical load and feature data sets of similar types is as follows: For ordinal data, the data is directly filled in order; for nominal data, seasonal factors are taken into consideration and the majority is taken after deleting null values ​​in this month.

5. The method for power system load forecasting based on double-layer XGBoost considering multiple features according to claim 1 is characterized in that: S403 outputs the prediction results, model parameters and selected features to rank the impact on the load and screen the features that significantly affect the load. The model parameters include Max_depthX1, Learning_rateX2, n_estimatorsX3, min_child_weightX4, subsampleX5, colsample_bytreeX6, gammaX7, reg_alphaX8, reg_lambdaX9, and early_stopping_roundsX10.

6. The method for power system load forecasting based on double-layer XGBoost considering multiple features according to claim 5 is characterized by: The model selection significantly affects the load characteristics including time X0, air pressure X2, air temperature X5, ground temperature X10, nearby transformer load X14, wind direction X15, wind speed X16, and previous period load X18.

Citation Information

Patent Citations

  • Extreme temperature meteorological day bus day-ahead load prediction method

    CN110826795A