User power failure multi-classification probability prediction method based on histogram gradient boosting tree

Through a multi-classification probability prediction method based on histogram gradient enhancement tree, the problem of insufficient accuracy and real-time accuracy of user power outage prediction in the prior art is solved, efficient processing and flexible adaptation of complex data are achieved, and prediction accuracy is significantly improved. Sex and real-time.

CN119026013APending Publication Date: 2024-11-26ELECTRIC POWER RES INST OF GUANGXI POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410929185.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing user power outage prediction methods are insufficient in processing complex multidimensional data and nonlinear relationships, poor real-time performance, difficult to meet the needs of large-scale data processing, and lack flexibility, and cannot adapt to different power systems and user environments.

Method used

Using a multi-classification probability prediction method based on histogram gradient enhancement tree, select key features through the Relief algorithm, build a histogram gradient enhancement tree model, optimize model parameters, use Softmax function and cross entropy loss function to predict, and combine with Bayesian optimization to adjust Hyperparameters to realize multi-categorized probability prediction of user power outage.

Benefits of technology

It significantly improves the accuracy and real-timeness of user power outage prediction, can quickly process large-scale data, provide accurate warning information, and assist power companies in quick decision-making and emergency response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026013A_ABST
    Figure CN119026013A_ABST
Patent Text Reader

Abstract

The invention discloses a user power failure multi-classification probability prediction method based on a histogram gradient boosting tree, and relates to the technical field of power consumption prediction, and the method comprises the steps: obtaining and cleaning user data, and selecting key features in the cleaned user data through employing a Relief algorithm; constructing a histogram gradient boosting tree algorithm model, setting initial parameters, and training the model by using the training set data to obtain a trained prediction model; and optimizing parameters of the prediction model to adjust hyper-parameters of the model, analyzing a prediction result of the model by using a multi-classification evaluation index, calculating a prediction probability of each category, and performing user power failure multi-classification probability prediction. According to the method, the accuracy of user power failure probability prediction is improved, rapid prediction of the user power failure probability is realized, early warning information can be provided in time, and an electric power company is assisted in rapid decision making and emergency response.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of electricity consumption prediction, in particular to a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree. Background Art

[0002] User power outage prediction is a key task in power system maintenance and management. Accurately predicting the probability of user power outages can help power companies take measures in advance to reduce the risk of power outages and improve the reliability of the power system. Specifically, when a possible power outage is predicted, power companies can deploy emergency resources in advance and quickly restore power supply.

[0003] At present, the methods for predicting power outages for users mainly include the following categories: ① Statistical analysis method: Statistical analysis based on historical data, predicting future power outages by calculating the frequency and duration of power outages. This type of method is simple and easy to use, but it cannot capture complex nonlinear relationships and dynamic changes. ② Expert experience method: Relying on the experience and knowledge of power system experts for prediction. Although experts are experienced, this method is highly subjective and difficult to standardize and promote.

[0004] Existing methods still have room for improvement in prediction accuracy, especially when dealing with complex multidimensional data and nonlinear relationships. Poor real-time performance: Some methods cannot meet the needs of real-time prediction, especially when responding to sudden power outages. Limited data processing capabilities: Existing methods have limited performance when processing large-scale, high-dimensional data, and it is difficult to fully utilize massive data for accurate predictions. Lack of flexibility: Existing methods have limitations in adapting to different scenarios and user needs, and are difficult to flexibly apply in different power systems and user environments. Summary of the invention

[0005] In view of the problems existing in the existing user power outage multi-classification probability prediction method based on histogram gradient boosting tree, the present invention is proposed. Therefore, the problem to be solved by the present invention is how to provide a user power outage multi-classification probability prediction method based on histogram gradient boosting tree.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In the first aspect, the present invention provides a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree, which includes obtaining user data and cleaning it, using a relief algorithm to select key features in the cleaned user data; constructing a histogram gradient boosting tree algorithm model, setting initial parameters, training the model using training set data, and obtaining a trained prediction model; optimizing the parameters of the prediction model to adjust the model's hyperparameters, using multi-classification evaluation indicators to analyze the model's prediction results, calculating the prediction probability of each category, and performing multi-classification probability prediction of user power outages.

[0008] As a preferred solution of the user power outage multi-classification probability prediction method based on histogram gradient boosting tree described in the present invention, wherein: the user data includes power consumption data, weather data and equipment data; the power consumption data includes power outage time, power consumption and power consumption time; the weather data includes historical and real-time weather data, including temperature, humidity, wind speed and rainfall; the equipment data includes voltage, current and power electrical variable curves of power equipment in the power supply area.

[0009] As a preferred solution of the user power outage multi-classification probability prediction method based on histogram gradient boosting tree described in the present invention, wherein: the key features in the cleaned user data selected by using the Relief algorithm include the following steps: constructing a feature matrix X and a corresponding target variable y constructed according to the power outage properties, the feature matrix X contains m samples, each sample has n features, and constructing a corresponding relationship between the target variable and the power outage properties; performing feature initialization, initializing the weight of each feature to 0, and randomly selecting a sample R i ; Find the nearest neighbor of the randomly selected sample, including the nearest neighbor H of the same type, among all the nearest neighbors with R i Find samples of the same category as R i The nearest sample; the heterogeneous nearest neighbor M, among all the samples with R i Find the samples with different categories and R i The nearest sample; update the feature weights for the sample with the nearest neighbor, and calculate the updated weight for each feature. The calculation formula is:

[0010]

[0011] In the formula, A is the characteristic, R i [A] is the value of the sample on feature A, and H is all the samples with R i The samples of the same category are i The most recent samples, M, are all samples with R i The samples with different categories are different from R i The most recent sample, m is the number of samples; repeat the steps until all samples are processed or the predetermined number of iterations is reached, sort them according to the size of the updated weights, and select the key features.

[0012] As a preferred solution of the multi-classification probability prediction method for power outage based on histogram gradient boosting tree of the present invention, wherein: the construction of the histogram gradient boosting tree algorithm model includes the following steps: converting a K-class classification problem into K binary classification problems, that is, for each category k∈[1,K], constructing a new target variable y k, obtain K training data sets for binary classification problems; perform histogram boxing on each continuous feature of the data set; initialize the model, and for each category k, use the CART regression tree algorithm to train the training data set and construct a regression tree T k,0 (x), for a new sample x, starting from the root node, traverse the internal nodes of the regression tree in sequence, assign x to a leaf node, and the prediction score z of the leaf node k (x) is the average value of the samples belonging to category k in the training samples on the leaf node. The expression of the initialization model is:

[0013]

[0014] In the formula, F0(x) is the initialized model, Θ0 is the initialization parameter, x is the sample, and k is the sample category; update the model and perform the update step in the mth iteration of the algorithm, m = 1, 2, …, M.

[0015] As a preferred solution of the multi-classification probability prediction method for power outage based on histogram gradient boosting tree of the present invention, wherein: the updating model comprises the following steps: k (x) is transformed through the Softmax function to obtain the predicted score z k (x) is transformed into a probability distribution P k (x), and obtain the probability distribution P of sample x belonging to each category k k (x), the conversion formula is:

[0016]

[0017] In the formula, z k (x) is the probability score of predicting sample x to belong to category k; calculate the negative gradient and fit the new regression tree, and update the model parameters for the training samples by minimizing the cross entropy loss function; in each iteration, calculate the corresponding negative gradient of the probability prediction result of the current model for each category in the training set, and use the negative gradient to update the model parameters. The calculation formula of the negative gradient is:

[0018]

[0019] In the formula, p ik For the model in sample x i The probability prediction of category k above; the negative gradient is used as the new target variable to form a new training sample For each class k, fit a regression tree T using CART k (x; Θ m ), the updated initial sample xi belongs to the probability score zk(x) of category k; calculate the regression tree T k (x; Θ m) output values ​​of each leaf node region, and use a single Newton-Raphson step-size approximation formula to calculate the solution under 1 step size, the calculation formula is:

[0020]

[0021] The regression tree T of each category k (x; Θ m ) is superimposed on the original model to iteratively update the model. The expression is:

[0022]

[0023] In the formula, F m (x) is the prediction model obtained by the mth round of training, Θ m The parameters of the regression tree obtained by the mth round of fitting, x is the sample, k is the sample category; the trained ensemble tree model is output through M-step iterations, and the expression is:

[0024] F M (x) = T1(x; θ M )+T2(x;Θ M )+…+T k (x; Θ M )

[0025] In the formula, k is the sample category, T k (x; Θ M ) represents the k-th category probability prediction result.

[0026] As a preferred solution of the user power outage multi-classification probability prediction method based on histogram gradient boosting tree of the present invention, the calculation formula for minimizing the cross entropy loss function is:

[0027]

[0028] In the formula, y ik ∈0,1 represents sample x i Whether it belongs to category k; N represents the number of samples in the training set.

[0029] As a preferred solution of the multi-classification probability prediction method for power outage based on histogram gradient boosting tree of the present invention, the method of optimizing the parameters of the prediction model and adjusting the hyperparameters of the model includes the following steps: defining the objective function, taking the performance evaluation index of the model as the objective function f(θ), wherein θ represents the combination of hyperparameters; constructing a priori model, and establishing a probability model of the objective function through initial parameter exploration; according to the currently observed objective function value, using the priori model to infer the next optimal hyperparameter combination, and selecting the maximum expected improvement or high confidence upper limit strategy for decision making, the expression is:

[0030]

[0031] Among them, θ * is the current optimal parameter combination, It is the expected operation; update the prior model according to the actual observation results, perform iterative optimization, repeat the steps until the preset number of iterations is reached or the convergence condition of performance improvement is reached, and find a better hyperparameter combination θ * .

[0032] In the second aspect, the present invention provides a user power outage multi-classification probability prediction system based on a histogram gradient boosting tree, which includes: an acquisition module, used to acquire user data and clean it, and use the Relief algorithm to select key features in the cleaned user data; a construction module, used to construct a histogram gradient boosting tree algorithm model, set initial parameters, train the model using training set data, and obtain a trained prediction model; a prediction module, used to optimize the parameters of the prediction model and adjust the hyperparameters of the model, use multi-classification evaluation indicators to analyze the prediction results of the model, calculate the prediction probability of each category, and perform multi-classification probability prediction of user power outages.

[0033] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, the steps of a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree are implemented.

[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, the steps of a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree are implemented.

[0035] The beneficial effect of the present invention is to improve the accuracy of the prediction of the probability of power outage for users by introducing the histogram gradient boosting tree algorithm, and significantly improve the accuracy of the prediction model by optimizing feature selection, model parameters and integrated learning strategies. By optimizing the model training and prediction process, using parallel computing and efficient data processing technology, the rapid prediction of the probability of power outage for users can be achieved, and early warning information can be provided in a timely manner to assist power companies in making rapid decisions and emergency responses. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0037] Figure 1This is a flowchart of the multi-classification probability prediction method for user power outages based on histogram gradient boosting tree.

[0038] Figure 2 This is the topological structure diagram of the improved IEEE33 node feeding system.

[0039] Figure 3 This is a multi-classification probability prediction result diagram for power grid outage events. DETAILED DESCRIPTION

[0040] In order to make the above-mentioned purposes, features and advantages of the present invention more understandable, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0041] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0042] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0043] Example 1

[0044] Reference Figure 1 , which is the first embodiment of the present invention, provides a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree, comprising:

[0045] S1: Obtain user data and clean it, and use the Relief algorithm to select key features in the cleaned user data;

[0046] Specifically, data collection includes the following types of data: Power consumption data: Obtain users' power consumption information from sources such as smart meters and power consumption records, including power outage time, power consumption, power consumption time, etc. Weather data: Obtain historical and real-time weather data from meteorological departments or third-party data providers, including temperature, humidity, wind speed, rainfall, etc. Equipment data: Collect voltage, current, and power electrical variable curves of power equipment (including distribution transformers, cables, switch cabinets, etc.) in the power supply area.

[0047] Construct a feature matrix X and a corresponding target variable y constructed according to the nature of the power outage. The feature matrix X contains m samples, each sample has n features, and the corresponding relationship between the target variable and the nature of the power outage is constructed; (X has m rows and n columns, and the size is m×n).

[0048] Table 1 Correspondence between target variable y and power outage nature

[0049]

[0050] Perform feature initialization, initialize the weight of each feature to 0, and randomly select a sample R i ;

[0051] Find the nearest neighbor of a randomly selected sample, including the nearest neighbor H of the same type, among all the neighbors with R i Find samples of the same category as R i The nearest sample; the heterogeneous nearest neighbor M, among all the samples with R i Find the samples with different categories and R i Recent samples;

[0052] Update the feature weights for the samples with the nearest neighbors, and calculate the updated weights for each feature. The calculation formula is:

[0053]

[0054] In the formula, A is the characteristic, R i [A] is the value of the sample on feature A, and H is all the samples with R i The samples of the same category are i The most recent samples, M, are all samples with R i The samples with different categories are different from R i The most recent sample, m is the number of samples;

[0055] Repeat the steps until all samples are processed or the predetermined number of iterations is reached, sort them according to the size of the updated weights, and select key features.

[0056] S2: Build a histogram gradient boosting tree algorithm model, set initial parameters, train the model using training set data, and obtain a trained prediction model;

[0057] Specifically, in multi-classification prediction problems, the HGTB algorithm uses a method that converts it into a binary classification problem. For K-class classification problems, the HGTB algorithm fits a regression tree for each class of samples (referring to the negative gradient calculated in the previous round) in each round of iteration, and then adds the K regression trees into the model together. The regression tree is used here because the regression tree outputs a real value at each leaf node, which can be converted into a probability score, while the classification tree outputs a sample label and cannot be used for multi-classification problems. The HGTB algorithm calculates a probability score for each class of samples and converts the probability score into an estimated value of the predicted probability through the Softmax function. In classification problems, common loss functions include cross entropy and exponential loss. The HGTB algorithm uses cross entropy as the loss function. The training method of the multi-classification probability prediction model based on HGTB is as follows:

[0058] (1) For a K-class classification problem, first convert it into K binary classification problems. That is, for each category k∈[1,K], construct a new target variable y k , where y k =1 means the sample belongs to category k, i.e., a positive example, y k = 0 means that the sample does not belong to category k, i.e., a counterexample. K training data sets for binary classification problems are obtained.

[0059] (2) Perform histogram boxing processing on each continuous feature of the data set.

[0060] (3) Initialize the model. For each category k, use the CART regression tree algorithm to train the training data set and construct a regression tree T k,0 (x), used to predict the probability score z that sample x belongs to category k k (x). The CART regression tree algorithm recursively divides the sample space into multiple subspaces and establishes a linear model in each subspace. For a new sample x, starting from the root node, traverse the internal nodes of the regression tree in turn, and assign x to a leaf node according to the node division rule. The prediction score z of the leaf node is k (x) is the average value of the samples belonging to category k in the training samples on the leaf node. The expression of the initialization model is:

[0061]

[0062] In the formula, F0(x) is the initialized model, Θ0 is the initialization parameter, x is the sample, and k is the sample category.

[0063] (4) Update the model. In the mth iteration of the algorithm, perform the following steps, where m = 1, 2, ..., M:

[0064] Step 1) Set the K prediction scores zk (x) is transformed through the Softmax function to obtain the probability distribution P of sample x belonging to each category k k (x), that is:

[0065]

[0066] In the formula, z k (x) is the probability score of predicting that sample x belongs to category k;

[0067] The Softmax function ensures that the sum of the predicted probability distributions of all categories is 1, and the predicted score z k (x) is transformed into a probability distribution P k (x).

[0068] Step 2) Calculate the negative gradient and fit a new regression tree to update the model parameters by minimizing the cross entropy loss function. Specifically, for a training sample (x i ,y i1 ,...,y iK ), where y ik ∈0,1 represents sample x i Whether it belongs to category k, the goal of the model is to minimize the following loss function:

[0069]

[0070] Where N represents the number of samples in the training set. The cross entropy loss function measures the difference between the probability distribution predicted by the model and the true distribution. The smaller the cross entropy value, the closer the prediction result is to the true label.

[0071] In each iteration, the corresponding negative gradient is calculated for the probability prediction result of the current model for each category in the training set, and then these negative gradients are used to update the model parameters so that the model can better fit the samples in the training set. i ,y i1 ,…,y iK ), where y ik ∈0,1 represents sample x i Whether it belongs to category k, the model is in sample x i The probability prediction for category k is p ik , then the corresponding negative gradient, that is, the formula is:

[0072]

[0073] Then, the negative gradient is used as the new target variable to form a new training sample For each class k, use CART to fit a regression tree T k (x; Θm ), and then update each sample x in step 1) i The probability score z of belonging to class k k (x).

[0074] In the CART fitting process, in order to obtain the regression tree T k (x; Θ m ) can be calculated using a single Newton-Raphson step-size approximation formula to calculate the solution at 1 step-size. The calculation formula is:

[0075]

[0076] Step 3) The regression trees T of each category k (x; Θ m ) is superimposed on the original model, that is, the iterative update of the model in formula (3.9) should be specifically:

[0077]

[0078] In the formula, F m (x) is the prediction model obtained by the mth round of training, Θ m The parameters of the regression tree obtained by the mth round of fitting, x is the sample, and k is the sample category.

[0079] Through the iteration of the above M steps, a trained ensemble tree model will be output, expressed as:

[0080] F M (x) = T1(x; θ M )+T2(x;Θ M )+…+T k (x; Θ M )

[0081] Where k is the sample category, T k (x; Θ M ) represents the k-th class probability prediction result. For multi-classification probability prediction of power grid outages, this integrated model actually outputs the probability distribution of samples, and takes the category with the highest probability as the prediction category. For new samples, directly take the new sample x as input to obtain the probabilities of different categories, T k (x; Θ M ) represents the k-th category probability prediction result.

[0082] S3: Optimize the parameters of the prediction model and adjust the model's hyperparameters. Use multi-classification evaluation indicators to analyze the model's prediction results, calculate the prediction probability of each category, and perform multi-classification probability prediction of user power outages.

[0083] Specifically, the multi-classification prediction method based on HGTB can not only give the level of power outage in the future, but also give the probability of power outage for each type of user. As shown in Table 1, user power outages are divided into no power outage, short power outage, ordinary power outage, and long power outage according to labels 0, 1, 2, and 3.

[0084] Model parameter tuning based on Bayesian optimization,further optimize the user power outage probability prediction model based on gradient boosting tree,using Bayesian optimization.,Hyperparameters are the key configuration of machine learning models,,which directly affect the performance and generalization ability of the model.

[0085] After completing the basic prediction model training, the parameters are Θ m , and then tune the parameters based on Bayesian optimization.

[0086] Bayesian optimization builds a probabilistic model of the objective function and iterates repeatedly based on existing observations (model performance) to find the optimal hyperparameter combination. Compared with traditional grid search methods, Bayesian optimization can more efficiently explore the hyperparameter space during the optimization process and find better hyperparameter settings in a relatively small number of iterations.

[0087] Define the objective function: Take the performance evaluation index of the model as the objective function f(θ), where θ represents the combination of hyperparameters. For example, we can choose accuracy, ROCAUC, or F1 score as the objective function.

[0088] Constructing a priori model: Through initial parameter exploration, a probability model of the objective function is established. Commonly used priori models include Gaussian Process or Random Forest, which help estimate the objective function value in unexplored areas.

[0089] Select the next parameter: Based on the currently observed objective function value, use the prior model to infer the next possible optimal hyperparameter combination. Bayesian optimization algorithms usually make decisions by selecting a strategy that maximizes the expected improvement or the upper confidence bound.

[0090] θ next = arg max θ E[max(f(θ)-f(θ * ),0)]

[0091] Among them, θ * is the current optimal parameter combination, and E is the expected operation.

[0092] Update the objective function model: Update the prior model according to the actual observation results to further improve the prediction accuracy of the objective function.

[0093] Iterative optimization: Repeat steps 3 and 4 above until the preset number of iterations is reached or the convergence condition for performance improvement is met.

[0094] Through Bayesian optimization, we can find a better hyperparameter combination θ in a shorter time * , thereby improving the prediction accuracy and generalization ability of the model. This method is particularly suitable for machine learning models with complex hyperparameter spaces and high computational costs, such as gradient boosting trees, and effectively improves the practicality and applicability of the model.

[0095] Furthermore, the present embodiment also provides a user power outage multi-classification probability prediction system based on a histogram gradient boosting tree, including: an acquisition module, used to acquire user data and clean it, and use the Relief algorithm to select key features in the cleaned user data; a construction module, used to construct a histogram gradient boosting tree algorithm model, set initial parameters, train the model using training set data, and obtain a trained prediction model; a prediction module, used to optimize the parameters of the prediction model and adjust the hyperparameters of the model, use multi-classification evaluation indicators to analyze the prediction results of the model, calculate the prediction probability of each category, and perform multi-classification probability prediction of user power outages.

[0096] This embodiment also provides a computer device, which is applicable to the case of a user power outage multi-classification probability prediction method based on a histogram gradient boosting tree, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement all or part of the steps of the method described in the embodiment of the present invention as proposed in the above embodiment.

[0097] This embodiment also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method in any optional implementation of the above embodiment is executed. Wherein, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0098] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0099] Example 2

[0100] Reference Figure 2 - Figure 3 , which is the second embodiment of the present invention, provides a user power outage multi-classification probability prediction method based on histogram gradient boosting tree. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0101] Based on the improved IEEE 33-node feeder system, the system has 33 nodes and 32 branches, and node 0 is the root node connected to the upper power grid.

[0102] The probability of power outages in the next hour of the power grid is predicted at 5-minute time intervals, and the classification results of the severity and length of power outages at each moment of the power grid are given. According to the probability prediction result graph, the power outage users are likely to experience ordinary power outages before 02:20 on November 10, 2021. After 02:20, ordinary power outages in the power grid will turn into long-term power outages, and power limit will exceed. In the point prediction result subgraph above, an error occurred in the power outage category at 2:20. The predicted category is ordinary power outage, while the true category is long-term power outage. The prediction situation lags slightly behind the actual situation. However, the real trend of power outages in the power grid can be analyzed in combination with the probability prediction result subgraph. The probability of ordinary power outages is gradually decreasing, while the probability of long-term power outages is gradually increasing. By 02:20, the probability of ordinary power outages has dropped to about 60%, while the probability of long-term power outages has risen to about 0.4, and it is likely to develop into a long-term power outage. This real-time prediction result of combining categories with probability distribution can provide intuitive category results and a basis for power outage trend analysis, and improve the ability to judge the overall power outage situation.

[0103] For the multi-classification problem of power outage, the HGTB algorithm was compared with other machine learning algorithms in terms of computational efficiency and accuracy using a data set. The algorithms compared include logistic regression (LR), support vector machine (SVM), K nearest neighbors (KN), Gaussian naive Bayes, and GNB), decision tree (DT). HGTB is a robust ensemble algorithm, and different ensemble ideas are also compared: bagging, random forest (RF), GTB. The following table shows the prediction accuracy of different algorithms for multi-classification of power outages, as well as the time for training and prediction of the data.

[0104] The accuracy in the table refers to the ratio of the number of samples correctly classified by the classification model in the test data set to the total number of samples in the test data set. The value outside the brackets represents the mean accuracy of each verification during the cross-validation process, and the value inside the brackets represents the variance.

[0105] Table 1 Comparison of accuracy and computational efficiency of different machine learning algorithms

[0106]

[0107]

[0108] As can be seen from the table, compared with other algorithms, the HGTB used in this method has the highest accuracy and the most stable prediction. The average accuracy in the ten-fold cross validation is 0.87 and the variance is only 0.04. In terms of training overhead, the training speed of HGTB is about 16 times that of GBDT. Efficient training enables HGTB to update the model in time in real-time problems to improve adaptability. The multi-classification probability prediction used in this method can provide comprehensive information, not only predicting whether there will be power outages in the future, but also predicting the severity and probability distribution of future power outages, so that power outages can be perceived in real time.

[0109] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A multi-classification probability prediction method for user power outage based on histogram gradient boosting tree, characterized by: include, Obtain user data and clean it, and use the Relief algorithm to select key features in the cleaned user data; Construct a histogram gradient boosting tree algorithm model, set initial parameters, train the model using training set data, and obtain a trained prediction model; The parameters of the prediction model are optimized and the hyperparameters of the model are adjusted. The prediction results of the model are analyzed using multi-classification evaluation indicators. The prediction probability of each category is calculated to perform multi-classification probability prediction of user power outages.

2. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 1, characterized in that: The user data includes electricity consumption data, weather data and equipment data; the electricity consumption data includes power outage time, electricity consumption and electricity consumption time; the weather data includes historical and real-time weather data, including temperature, humidity, wind speed and rainfall; the equipment data includes voltage, current and power electrical variable curves of power equipment in the power supply area.

3. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 2, characterized in that: The Relief algorithm is used to select key features in the cleaned user data The following steps are included: Construct the feature matrix X and the corresponding target variable y constructed according to the nature of the power outage. The feature matrix X contains m samples, each sample has n features, and the corresponding relationship between the target variable and the nature of the power outage is constructed; Perform feature initialization, initialize the weight of each feature to 0, and randomly select a sample R i ; Find the nearest neighbor of a randomly selected sample, including the nearest neighbor H of the same type, among all the neighbors with R i Find samples of the same category as R i The nearest sample; the heterogeneous nearest neighbor M, among all the samples with R i Find the samples with different categories and R i Recent samples; Update the feature weights for the samples with the nearest neighbors, and calculate the updated weights for each feature. The calculation formula is: In the formula, A is the characteristic, R i [A] is the value of the sample on feature A, and H is all the samples with R i The samples of the same category are i The most recent samples, M, are all samples with R i The samples with different categories are different from R i The most recent sample, m is the number of samples; Repeat the steps until all samples are processed or the predetermined number of iterations is reached, sort them according to the size of the updated weights, and select key features.

4. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 3, characterized in that: The construction of the histogram gradient boosting tree algorithm model includes the following steps: Convert a K-class classification problem into K binary classification problems, that is, for each category k∈[1,K], construct a new target variable y k , get the training data set of K binary classification problems; Perform histogram boxing processing on each continuous feature of the data set; Initialize the model, for each category k, use the CART regression tree algorithm to train the training data set and build a regression tree T k,0 (x), for a new sample x, starting from the root node, traverse the internal nodes of the regression tree in sequence, assign x to a leaf node, and the prediction score z of the leaf node k (x) is the average value of the samples belonging to category k in the training samples on the leaf node. The expression of the initialization model is: In the formula, F0(x) is the initialized model, Θ0 is the initialization parameter, x is the sample, and k is the sample category; Update the model and perform the update step in the mth iteration of the algorithm, where m = 1, 2, …, M.

5. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 4, characterized in that: The updating model comprises the following steps: The K prediction scores z k (x) is transformed through the Softmax function to obtain the predicted score z k (x) is transformed into a probability distribution P k (x), and obtain the probability distribution P of sample x belonging to each category k k (x), the conversion formula is: In the formula, z k (x) is the probability score of predicting that sample x belongs to category k; Calculate the negative gradient and fit the new regression tree, and update the model parameters by minimizing the cross entropy loss function for the training samples; In each iteration, the corresponding negative gradient is calculated for the probability prediction result of the current model for each category in the training set, and the negative gradient is used to update the model parameters. The calculation formula of the negative gradient is: In the formula, p ik For the model in sample x i The probability prediction for category k above; Use the negative gradient as the new target variable to form a new training sample For each class k, fit a regression tree T using CART k (x; Θ m ), updated initial sample x i The probability score z of belonging to class k k (x); Calculate the regression tree T k (x; Θ m ) output values ​​of each leaf node region, and use a single Newton-Raphson step-size approximation formula to calculate the solution under 1 step size, the calculation formula is: The regression tree T of each category k (x; Θ m ) is superimposed on the original model to iteratively update the model. The expression is: In the formula, F m (x) is the prediction model obtained by the mth round of training, Θ m The parameters of the regression tree obtained by the mth round of fitting, x is the sample, k is the sample category; The trained ensemble tree model is output through M-step iterations, and the expression is: F M (x)=T1(x;Θ M )+T2(x;Θ M )+…+T k (x;Θ M ) In the formula, k is the sample category, T k (x; Θ M ) represents the k-th category probability prediction result.

6. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 5, characterized in that: The calculation formula for minimizing the cross entropy loss function is: In the formula, y ik ∈0,1 represents sample x i Whether it belongs to category k; N represents the number of samples in the training set.

7. The method for predicting user power outage multi-classification probability based on histogram gradient boosting tree according to claim 6, characterized in that: The step of optimizing the parameters of the prediction model and adjusting the hyperparameters of the model comprises the following steps: Define the objective function and use the performance evaluation index of the model as the objective function f(θ), where θ represents the combination of hyperparameters; Construct a priori model and establish the probability model of the objective function through initial parameter exploration; According to the currently observed objective function value, the prior model is used to infer the next optimal hyperparameter combination, and the maximum expected improvement or high confidence upper limit strategy is selected for decision making. The expression is: Among them, θ * is the current optimal parameter combination, It is the expected operation; Update the prior model according to the actual observation results, perform iterative optimization, repeat the steps until the preset number of iterations is reached or the convergence condition of performance improvement is reached, and find a better hyperparameter combination θ * .

8. A user power outage multi-classification probability prediction system based on histogram gradient boosting tree, based on the user power outage multi-classification probability prediction method based on histogram gradient boosting tree according to any one of claims 1 to 7, characterized in that: include, The acquisition module is used to acquire user data and clean it, and use the Relief algorithm to select key features in the cleaned user data; The construction module is used to construct the histogram gradient boosting tree algorithm model, set the initial parameters, train the model using the training set data, and obtain the trained prediction model; The prediction module is used to optimize the parameters of the prediction model, adjust the model's hyperparameters, use multi-classification evaluation indicators to analyze the model's prediction results, calculate the prediction probability of each category, and perform multi-classification probability prediction of user power outages.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the user power outage multi-classification probability prediction method based on the histogram gradient boosting tree according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting the multi-classification probability of power outage based on the histogram gradient boosting tree according to any one of claims 1 to 7 are implemented.