Power customer complaint prediction method based on ADASYN-EAA-XGBoost algorithm
By using ADASYN-EAA-XGBoost algorithm in power customer complaint prediction, the problem of insufficient prediction accuracy and efficiency in the existing technology is solved, and higher prediction accuracy and faster processing speed are achieved, which improves power companies service quality and customer satisfaction.
Patent Information
- Application Number
- CN202411299291.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, in the prediction of power customer complaints, it is difficult to ensure prediction accuracy and efficiency, and the customer portrait label construction method is simple and cannot fully reflect the characteristics of customer demands.
The power customer complaint prediction method based on ADASYN-EAA-XGBoost algorithm is adopted to construct power customer portrait tags through data processing, the data set is balanced using ADASYN algorithm, the EAA algorithm weights the data samples, and the complaint tendency prediction is made using XGBoost algorithm.
It improves the accuracy and efficiency of predicting customer complaint tendencies, can handle customer complaints faster and better, improve service quality of power companies, reduce the number of customer complaints, and improve customer satisfaction.
Smart Images

Figure CN119398792A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent management of electric power systems, and in particular to an electric power customer complaint prediction method based on an ADASYN-EAA-XGBoost algorithm. Background Art
[0004] In the power industry, customer complaints are a common problem. However, in the past, many power companies often handled customer complaints passively and lagging behind. When customer complaints occur, companies will take measures to solve the problem, and this approach often leads to problems such as decreased customer satisfaction and damaged corporate image. In order to gain an advantage in the fierce market competition, power companies need to change their traditional approach, change from passive to active, and predict and solve customer complaints in advance. Therefore, predicting and managing power customer complaints has become an important task for power companies. Since customer complaints and customer churn are largely affected by the perception of the customer itself, and in a specific time period, a specific area, or a specific customer group, the customer's perception is often strongly related to the customer's basic attributes and customer usage status. Therefore, integrating customer hot complaints through label construction and carrying out customer complaint prediction work in a targeted manner can provide efficient and scientific reference and basis for the optimization of services, products, processes, etc.
[0005] With the gradual development of the service industry, relevant research on customer service has also emerged. In 2019, Mu Xiaoma constructed a customer complaint prediction model based on GA-BP neural network. In 2020, Pei Qianwen used the naive Bayes and RF classification algorithm models to realize complaint tendency prediction. In 2020, Yue Danyang et al. proposed a customer complaint classification method based on Filter model and random forest. In 2021, Liu Zhanyu proposed an RF algorithm improved based on SMOTE and Bayesian optimization algorithm to realize complaint prediction. In 2023, Zhang Mei et al. proposed a customer complaint prediction method based on local linear embedding and deep forest algorithm. In 2023, Wu Xiaogui used Stacking to combine the XGBoost algorithm optimized by the Integration method loss to realize e-commerce customer complaint and churn prediction.
[0006] Since the XGBoost algorithm has a good effect on prediction problems, the technology using related algorithms is also increasing year by year. In 2020, Yuan Lixin et al. used the strong ensemble classifier XGBoost algorithm for feature selection, established a classification model, constructed an unbalanced data set and identified three types of spam advertising accounts. In 2021, Zhang Youwen et al. studied a fault diagnosis method for oil-immersed transformers based on genetic algorithm optimized extreme gradient boosting (XGBoost). In 2023, Yang Jie established a user complaint risk prediction model for XGBoost. Rodrigo Asencio et al. aimed to design 6 profit scoring models, using multilayer perceptron, XGBoost and TabNet algorithms to predict the internal rate of return (IRR) of credit applications, so as to serve as a support tool for credit analysts. Ramshankar et al. proposed to use the Whale optimization algorithm to optimize the weight parameters of XGboost to realize customer evaluation of products. Wang Kui et al. used the Logistc regression method for feature selection, used the XGBoost method for default discrimination, and constructed a personal credit risk assessment model.
[0007] To successfully solve the problem of predicting the tendency of power customers to complain, it is necessary to analyze from two aspects: on the one hand, how to obtain data that can truly and effectively reflect the real-time status of power customers; on the other hand, how to accurately predict the tendency of future power customers to complain based on power customer portrait labels. If the above two problems are successfully solved, the problem of predicting the tendency of power customers to complain can be easily solved. However, in existing research, the method for constructing power customer portrait labels is relatively simple, and cannot fully and effectively reflect the characteristics of power customers' demands. Especially in the actual application process, the sample balance and practical applicability of label data when inputting the model are not considered; in addition, the existing technology needs to improve the prediction accuracy and efficiency in the process of predicting power customer complaints. Therefore, those skilled in the art need a method that can optimize the prediction efficiency of the model while ensuring the prediction accuracy. Summary of the invention
[0008] The purpose of the present invention is to solve the above problems and design a power customer complaint prediction method based on ADASYN-EAA-XGBoost algorithm.
[0009] The technical solution of the present invention to achieve the above-mentioned purpose is a method for predicting power customer complaints based on the ADASYN-EAA-XGBoost algorithm, which comprises:
[0010] Data processing: perform feature data processing on the data source to construct a power customer portrait label;
[0011] Optimize the data set, use the ADASYN algorithm to balance the positive and negative categories of the power customer portrait label data to obtain an optimized data set, and then use the EAA algorithm to weight the data samples in the data set;
[0012] To predict the complaint tendency, feature labels related to the complaint tendency of power customers in the data set are selected, and the extreme gradient boosting algorithm (i.e., XGBoost algorithm) is used to predict the complaint tendency of power customers based on the data characteristics of the power customer portrait labels.
[0013] The data processing process includes:
[0014] First, the data source is aggregated and analyzed according to the customer number. Through multi-dimensional mining and analysis of the work order data, the types in the work order data are extracted, and the required labels are constructed based on the types in the work order data. Then, customer portrait labels are constructed and users with complaints are screened out.
[0015] The data source is all work orders in "95598 Accepted Work Orders" related to customers who have made complaints.
[0016] The power customer portrait labels include: (1) call track_order, (2) call time span time, (3) day of the week tell_week, (4) month of the week tell_month, (5) call frequency call_fre, (6) number of complaints numcom, (7) average power outage demand interval ave_demand, (8) comprehensive sentiment score sum_score, and (9) power outage type consistency if_topic.
[0017] The process of the ADASYN algorithm to balance the sample data positively and negatively includes:
[0018] (1) Use the k-nearest neighbor method to calculate the density t of samples around the complaint customer category sample;
[0019] (2) According to the value of t, calculate the number of synthetic samples that need to be generated, where the generation ratio is proportional to the density;
[0020] (3) Generate a certain number of synthetic samples based on the calculated generation ratio. The characteristics of the synthetic samples are the weighted sum of the differences between the original sample characteristics and the characteristics of its neighboring samples.
[0021] The process of weighting the data samples in the data set by the EAA algorithm includes:
[0022] The constructed power customer image labels are given realistic weights, and then the labels are weighted using the entropy weight evaluation method. The comprehensive weights are calculated and the calculation formula for the comprehensive weights is obtained.
[0023] The process of predicting the complaint tendency of power customers by using the extreme gradient boosting algorithm includes:
[0024] (1) Divide the weighted data set of the EAA algorithm into a training set and a validation set, with a ratio of training set: validation set = 4:1;
[0025] (2) Use the XGBoost algorithm to build a model, use the default model parameters, use the training set data set to train the model parameters, and perform parameter tuning;
[0026] (3) GridSearchCV (grid search) is used to tune the model parameters and find the optimal parameters of the model. The parameters of the XGBoost model are tuned using the results of parameter tuning, setting the learning rate learning_rate to 0.1, determining the tree depth max_depth to 11, the regularization term weight reg_alpha to 0.8, and the number of iterations nround to 150; the objective loss function uses reg:linear; the rest of the model parameters are set to default parameters; the customer complaint risk prediction model is essentially a classification prediction model. If the probability of belonging to the positive class is greater than 0.5, the prediction score is l, otherwise the prediction score is 0;
[0027] (4) The XGBoost algorithm with optimized parameters was used to establish a prediction model for power customer complaints, and the verification data set was used to predict the complaint tendency of power customers;
[0028] (5) Finally, confusion matrix, ACC, Recall, Precision, F1-score, and running time algorithm evaluation parameters are used to verify the superiority of the designed power customer complaint model.
[0029] Beneficial Effects
[0030] A power customer complaint prediction method based on the ADASYN-EAA-XGBoost algorithm produced by the technical solution of the present invention has the following advantages:
[0031] 1. The model constructed in this application has a high prediction accuracy for customer complaint tendency, and the model runs faster, which can handle customer complaints better and faster, thereby better improving the service quality of the power company;
[0032] 2. This application predicts the complaint tendency of power company customers through the ADASYN-EAA-XGBoost algorithm, which can effectively help the relevant departments of the power company understand customer demands, thereby reducing the number of customer complaints and improving customer satisfaction with the power company's services;
[0033] 3. This application analyzes the work order data of power customers, extracts labels that effectively reflect customer characteristics, and uses the ADASYN-EAA algorithm to optimize the data set from multiple dimensions to improve the practical applicability of the work order data of power customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a principle block diagram of a method for predicting power customer complaints based on the ADASYN-EAA-XGBoost algorithm described in the present invention;
[0035] Figure 2 is a schematic diagram of a hierarchical structure model in Embodiment 1 of the present invention;
[0036] Figure 3 : is a comparison diagram of the confusion matrices of the algorithms described in the present invention, wherein: (a) the confusion matrix of the XGBoost algorithm; (b) the confusion matrix of the RF algorithm; (c) the confusion matrix of the SVM algorithm; (d) the confusion matrix of the LightBGM algorithm; (e) the confusion matrix of the Catboost algorithm;
[0037] Figure 4 It is the label list in Example 1 of the present invention;
[0038] Figure 5 is the complaint prediction label weight table in Example 1 of the present invention;
[0039] Figure 6 This is a comparison table of prediction accuracy of each algorithm model in Example 1 of the present invention;
[0040] Figure 7 This is a comparison table of the results of various algorithm models in Example 1 of the present invention. DETAILED DESCRIPTION
[0041] The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings;
[0042] Embodiment 1;
[0043] like Figure 1-7 As shown in the figure, complaint prediction refers to predicting possible customer complaints in the future by collecting and analyzing historical data and related information of customer complaints, so as to take measures in advance to reduce or avoid the occurrence of complaints. Complaint prediction can help companies better understand customer needs and problems, improve products or services, and increase customer satisfaction and loyalty. Complaint prediction is essentially a binary classification problem, so the algorithm model used in predicting customer complaint tendency should have a good effect on solving classification problems.
[0044] The Adaptive Synthetic Sampling (ADASYN) algorithm is a sample generation method for dealing with class imbalance problems. It is mainly used for classification tasks and aims to balance the class distribution by adaptively generating synthetic samples to increase the number of samples in the minority class to improve the performance of the model. The main idea of the ADASYN algorithm is to oversample samples of different classes to varying degrees according to the distribution density of different samples. Specifically, the lower the density of the class, the more synthetic samples are generated. This balances the number of samples between different classes while maintaining the diversity of the data. Compared with other oversampling methods, ADASYN can better maintain the diversity of the data and avoid the problem of overfitting.
[0045] The XGBoost (Extreme Gradient Boosting) algorithm was proposed by Dr. Tianqi Chen of the University of Washington. Currently, the XGBoost algorithm is widely used in demand recommendation, search, user behavior prediction, etc., and has a good effect.
[0046] XGBoost is a supervised algorithm implemented by Gradient Tree Boosting, which can effectively solve classification, regression and other prediction problems. Suppose there is a data set (x i ,y i ), then the definition of the XGBoost model is:
[0047]
[0048] Where: x i ∈R m ,y i ∈R,x i is the m-dimensional input feature vector; y i Represents the output vector, and the model includes K trees.
[0049] In the process of model training, to ensure that the training effect reaches the ideal goal, it is necessary to determine the optimization direction and construct the objective function. The following formula is the definition of the objective function of XGBoost:
[0050]
[0051] Where: the first term is the loss function, which is used to evaluate the gap between the model's predicted value and the actual value; and the second part is the regularization term, which is used to control the complexity of the model and prevent the model from overfitting.
[0052] The definition of regularization is as follows:
[0053]
[0054] Where: The first part of γT controls the complexity of the tree through the leaf nodes and coefficients of the decision tree. The larger its value, the larger the objective function, thereby suppressing the complexity of the model; the second part is the L2 regularization term, which is used to control the weight score of the leaf node. In general, the optimization goal of the final model is to find the optimal f(x i ), so that the value of the objective function Obj is minimized.
[0055] First, in the data preprocessing stage, the power customer portrait label is constructed by "95598 Accepted Work Order", and the feature labels related to the power customer complaint tendency are selected. The ADASYN algorithm is used to balance the positive and negative categories of the data to obtain an optimized data set (see Section 3 for the specific label construction method and details). Then the EAA algorithm is used to weight the data samples. Then the optimized data set is applied, and the data set is used to compare and verify the superiority of the algorithm. Finally, the XGBoost algorithm is used in the model application stage to predict the complaint tendency of power customers. Figure 1 Shown is a schematic diagram of the complaint prediction model.
[0056] Data source analysis
[0057] "95598 Work Order" is an information table generated by the power grid customer service by summarizing the power customers' electricity-related demands and collecting information such as the time and type of the demands. The data source used in Example 1 is all work orders related to customers who have made complaints. In short, all work orders need to be summarized according to the customer number first, and constructed according to the customer portrait label, and then the users with complaints are screened out. There are a total of 1,048,468 work order data that need to be processed, of which there are 10,283 complaint work orders and 8,202 customers with complaints.
[0058] Positive and negative sample balance
[0059] After constructing the prediction labels and weighting, the article will use the ADASYN algorithm to balance the sample data. The main process is divided into three steps:
[0060] (1) Use the k-nearest neighbor method to calculate the density t of samples around the complaint customer category sample.
[0061] (2) According to the value of t, calculate the number of synthetic samples that need to be generated, where the generation ratio is proportional to the density.
[0062] (3) Generate a certain number of synthetic samples based on the calculated generation ratio. The characteristics of the synthetic samples are the weighted sum of the differences between the original sample characteristics and the characteristics of its neighboring samples.
[0063] After achieving sample balance through the above steps, the total number of positive and negative samples is 27464, of which the ratio of positive and negative samples is 17262:10202.
[0064] Customer portrait label construction
[0065] Through multi-dimensional mining and analysis of work order data, a variety of relevant work order data are extracted to screen out users with power outage demands, and the required labels are constructed based on the types in the work order data. Figure 4 Details of the tags for the build.
[0066] (1)Call track_order
[0067] Since power outage demands have temporal and spatial characteristics, that is, they are "non-independent" when reflected in work orders, power customers will frequently call to inquire about the power outage resolution status during peak hours before the power outage demands are resolved. The construction method of the power user trajectory sequence Track_Order is as follows:
[0068] First, the contact phone number field is used as the user identifier, that is, "tel", and combined with the power outage request work order through data preprocessing, the power outage request trajectory matrix of each user in a certain time period is constructed. Assuming that the user calls a total of 5 times in the specified time period, the generated work order category codes are 1, 3, 3, 5, and 9. The work order category code is the value of the field "busi_type_code", "1" represents fault repair; "3" represents inquiry and consultation; "5" represents complaint; "9" represents opinion (suggestion).
[0069] (2) Incoming call time span time
[0070] By counting all the power outage request work order records of each user, the final result t is calculated last The relevant formula is as follows:
[0071] t last =t final -t begin (4)
[0072] Where t final The time of the last work order request; t begin The time when the first work order is requested.
[0073] Since the time span of the dataset is three years, the time span of calls is measured in months.
[0074] (3) Which day of the week do you call? tell_week
[0075] After classifying the outage request work orders, the time information of each user work order is extracted, that is, the day of the week the work order is accepted. If there are multiple outage request work orders, since power customers are very sensitive to power outages on weekdays and weekends, the weighted average method is used to calculate the average time point. When constructing this feature, the week number is converted into a processable vector according to the time code table.
[0076] (4) Call month tell_month
[0077] When constructing the call month tell_month feature label, the same method as when constructing the Tell_Week feature label is used. The weighted average method is also used to calculate the average month.
[0078] (5)Call frequency call_fre
[0079] The call frequency refers to the number of power outage complaint work orders generated by power customers within a specified time. The call frequency can reflect the urgency of power customers in solving their complaints and can, to a certain extent, be used as an indicator to evaluate the sensitivity of power customers.
[0080] (6)Number of complaints numcom
[0081] Filter the number of complaint work orders among power customers' power outage complaint work orders based on the field "busi_type_code".
[0082] (7) Average power outage demand interval ave_demand
[0083] The average power outage demand interval refers to the average interval between power customers generating power outage demands. The average power outage demand interval ave_demand is:
[0084]
[0085] Where: Ttime is the time span of incoming calls; numcall_fre is the frequency of incoming calls.
[0086] Since the unit of the call time span Ttime is day, the unit of the average power outage demand interval ave_demand is also day.
[0087] (8) Comprehensive sentiment score sum_score
[0088] Conduct text mining on the accepted content, realize sentiment recognition, and calculate the text sentiment score. Use a statistical-based word segmentation method to segment the appeal text, calculate the text sentiment score by counting the frequency of optimistic and pessimistic words, and perform weighted processing on the frequency of the two words.
[0089] (9) Power outage type consistency if_topic
[0090] The consistency of power outage type refers to whether the types of power outage-related requests made by power customers are the same when they seek help through the 95598 hotline, that is, whether the work order categories are the same. This feature tag can be represented by the field "busi_type_code". When constructing the actual feature tag, the number of request work order categories is used as the value of the power outage type consistency if_topic.
[0091] The entropy weight method is an objective value assignment method. In the specific use process, the entropy weight method uses information entropy to calculate the entropy weight of each indicator according to the degree of variation of each indicator, and then uses the entropy weight to correct the weight of each indicator, thereby obtaining a more objective indicator weight.
[0092] The basic principle of the entropy weight method is as follows:
[0093] (1) Construct an indicator system based on the source data and obtain the original matrix X corresponding to each indicator = (x ij ) nxm .
[0094] (2) Since different indicators have different units, normalization should be performed before entropy weight calculation. Before normalization, the direction of the indicator should be determined according to the actual problem, that is, whether the indicator is a positive indicator or a negative indicator. The calculation formulas for positive and negative indicators are as follows:
[0095] x' ij =x ij (6)
[0096] x' ij =max(x ij )-x ij (7)
[0097] (3) Data normalization
[0098] Due to the number and difference of each indicator, it is necessary to unify each indicator into a range. This chapter adopts the maximum and minimum value standardization method. Since the data matrix after the indicator is forward processed is X'=(x ij ') nxm , then the normalized formula is:
[0099]
[0100] Where: i = 1, 2, 3, ..., m; j = 1, 2, 3, ..., n; pij is the specific gravity
[0101] (5) Calculate information entropy
[0102] Assuming that information entropy is Ej, then
[0103]
[0104]
[0105] Where: i = 1, 2, 3, ..., m; j = 1, 2, 3, ..., n; p ij For the specific gravity.
[0106] (6) Calculate weight
[0107] The weight of each indicator can be calculated by calculating the information entropy. The weight calculation formula is as follows:
[0108]
[0109] Then the entropy weight index score Si is:
[0110]
[0111] The analytic hierarchy process, referred to as AHP, is an algorithm in the evaluation model. It refers to a decision-making method that decomposes the elements related to decision-making into levels such as goals, criteria, and plans, and conducts qualitative and quantitative analysis on this basis. The analytic hierarchy process is generally divided into three steps, namely, establishing a hierarchical model, constructing a judgment matrix, hierarchical single sorting, and consistency testing.
[0112] (1) Establishing a hierarchical model
[0113] like Figure 2 The hierarchical model constructed in Example 1 is shown.
[0114] (2) Constructing the judgment matrix
[0115] The judgment matrix is used to represent the relative importance of all factors in this layer relative to a factor in the previous layer. The element aij of the judgment matrix represents the comparison result of the i-th factor relative to the j-th factor, and the element value is obtained according to the 1-9 scale.
[0116] (3)Consistency test
[0117] Principle of consistency: Check whether there is a big difference between the constructed judgment matrix and the consistency matrix.
[0118] The consistency check is divided into three steps:
[0119] Step 1: Calculate the consistency index CI. The following formula is the calculation formula of CI:
[0120]
[0121] When CI = 0, there is complete consistency; when CI approaches 0, there is satisfactory consistency; the larger the CI, the more serious the inconsistency.
[0122] Step 2: Find the average random consistency index RI corresponding to the problem.
[0123] Step 3: Calculate the test coefficient CR, the formula is as follows:
[0124]
[0125] Generally, if the CR value is less than 0.1, the judgment matrix is considered to have passed the consistency test, otherwise it is judged that the consistency cannot be met.
[0126] However, the defect of a single analytic hierarchy process is that the judgment matrix is subjectively determined and an objective evaluation cannot be obtained. Therefore, Example 1 proposes an optimization entropy weight method based on the analytic hierarchy process.
[0127] In the actual work of the State Grid, the importance of indicators has a fixed standard. Therefore, in order to improve the practical significance of the model and the accuracy of the model input data, the hierarchical analysis method is used to artificially weight the entropy weight method, namely the EAA algorithm.
[0128] First, the constructed labels are given realistic weights through the expert scoring method, and then the labels are weighted through the entropy weight evaluation method. The comprehensive weight is calculated using the following formula. Assuming the comprehensive weight is Fini, the weight calculation formula is as follows:
[0129]
[0130] Where: m i is the weight obtained by the hierarchical analysis method, n i is the weight obtained by the entropy weight method, i is the nth indicator, and n refers to the number of indicators.
[0131] Before predicting complaints, the selected labels are first processed by optimizing the entropy weight method.
[0132] The labels are processed by entropy weight method to obtain the weights of each label. The corresponding weights of each label are (number of complaints: 0.19004), (frequency of calls: 0.06003), (time span of calls: 0.18012), (average time interval between complaints: 0.21411), (comprehensive sentiment score: 0.249121), (consistency of complaints: 0.02685), (call trajectory: 0.03017), (day of the week calls: 0.026561), and (month of calls: 0.02403).
[0133] After obtaining the label weights of the traditional entropy weight method, it is necessary to obtain another label weight through the hierarchical analysis method. Example 1 obtained a comprehensive hierarchical analysis method label evaluation by conducting a questionnaire survey on multiple experts and combining it with the actual application situation.
[0134] The judgment matrix Matrix can be obtained from the power outage sensitivity label evaluation table. According to the obtained judgment matrix, the maximum eigenvalue λmax=9.72411 can be calculated. The consistency test formula can be used to obtain CR=0.06075. Obviously, CR<0.1, so the judgment matrix passes the consistency test.
[0135] Therefore, the label weights finally obtained by the hierarchical analysis method are [0.35902, 0.13716, 0.088556, 0.08009, 0.07534, 0.05740, 0.06729, 0.07011, 0.06502].
[0136] Combining the label weights obtained in the two steps, the new label weights are calculated by optimizing the entropy weight method. Figure 5 shown.
[0137] The environment used in Example 1 is as follows: win10 operating system, computer memory 16GB, processor is Intel(R) Core(TM) i7-9700F CPU@3.00GHz, the simulation experiment is carried out on PyCharm 2020.1 (Community Edition), and the Python version is Python3.6.0.
[0138] Example 1 uses customer portrait data after label construction and data preprocessing as the data source, which has a total of 370,526 data sources. Each data contains the portrait features of a specified power customer, such as call trajectory, call frequency, number of complaints, and other labels. After balancing, a total of 27,464 data are involved in model training. During the experiment, the ratio of training set to test set in the data set is 4:1.
[0139] Verification of the advancement of algorithm models
[0140] In order to verify the superiority of the model, this chapter uses five algorithms, namely XGBoost, Random Forest (RF), SVM, LightGBM, and CatBoost, to conduct experiments to predict the complaint tendency of power customers. At the same time, the advantages and disadvantages of each model are analyzed from four perspectives: model accuracy, model confusion matrix, model ROC curve, and model evaluation index.
[0141] 1. Comparison of model accuracy
[0142] like Figure 6As shown, it can be found that the accuracy of XGBoost and CatBoost on both the training set and the test set is over 90%, so the effects of the above two models are better than other models.
[0143] 2. Model confusion matrix comparison
[0144] After the model is run, the confusion matrix heat map of each result is drawn separately, such as Figure 3 As shown in the figure, the prediction accuracy of each model can be judged by the color depth of each area. The darker the color of the TP and TN areas, the higher the model accuracy; the darker the color of the FP and FN areas, the lower the model accuracy. Therefore, by comparing and combining the color depth of the four areas, it can be judged that the prediction accuracy of the XGBoost algorithm, RF algorithm, and Catboost algorithm is the highest.
[0145] like Figure 7 As shown in the figure, the higher the ACC value, the more accurate prediction samples there are, and the better the model prediction effect. By comparing the ACC values of each model, it is easy to find that the XGBoost and CatBoost models have the best prediction effect. Although Recall and Precision have different meanings, their values are positively correlated with the model prediction effect, that is, the larger the value, the better the model prediction effect. Therefore, it can be judged that the prediction effects of XGBoost, RF and CatBoost are all good. Recall and Precision have certain limitations in judging the quality of the model, so the auxiliary judgment of F1-score can reduce this limitation to a certain extent. The higher the F1-score value, the better the model effect. From this, it can still be judged that the XGBoost and CatBoost models have the best prediction effect.
[0146] In summary, the prediction effects of XGBoost and CatBoost models are comparable, and each evaluation parameter reflects that the prediction effect is better than other models. However, after comparing the running time, it can be found that when the prediction accuracy is almost the same, the XGBoost model has a shorter running time and higher efficiency. Therefore, the model selected in Example 1 has higher accuracy, faster running speed, and the highest advancement.
[0147] It should be noted that the process of predicting the complaint tendency of power customers by using the extreme gradient boosting algorithm includes:
[0148] (1) Divide the weighted data set of the EAA algorithm into a training set and a validation set, with a ratio of training set: validation set = 4:1;
[0149] (2) Use the XGBoost algorithm to build a model, use the default model parameters, use the training set data set to train the model parameters, and perform parameter tuning;
[0150] (3) GridSearchCV (grid search) is used to tune the model parameters and find the optimal parameters of the model. The parameters of the XGBoost model are tuned using the results of parameter tuning, setting the learning rate learning_rate to 0.1, determining the tree depth max_depth to 11, the regularization term weight reg_alpha to 0.8, and the number of iterations nround to 150. The objective loss function uses reg:linear; the rest of the model parameters are set to default parameters. The electric customer complaint risk prediction model is essentially a classification prediction model. If the probability of belonging to the positive class is greater than 0.5, the prediction score is l, otherwise the prediction score is 0;
[0151] (4) The XGBoost algorithm with optimized parameters was used to establish a prediction model for power customer complaints, and the verification data set was used to predict the complaint tendency of power customers;
[0152] (5) Finally, confusion matrix, ACC, Recall, Precision, F1-score, and running time algorithm evaluation parameters are used to verify the superiority of the designed power customer complaint model.
[0153] The above technical solutions only reflect the preferred technical solutions of the technical solutions of the present invention. Some changes that may be made to certain parts thereof by technicians in this technical field all reflect the principles of the present invention and fall within the protection scope of the present invention.
Claims
1. A method for predicting power customer complaints based on the ADASYN-EAA-XGBoost algorithm, characterized in that: The method includes: Data processing: perform feature data processing on the data source to construct a power customer portrait label; Optimize the data set, use the ADASYN algorithm to balance the positive and negative categories of the power customer portrait label data to obtain an optimized data set, and then use the EAA algorithm to weight the data samples in the data set; Predict complaint tendency: According to the data characteristics of power customer portrait labels, the extreme gradient boosting algorithm is used to predict the complaint tendency of power customers.
2. According to claim 1, a method for predicting electric power customer complaints based on the ADASYN-EAA-XGBoost algorithm is characterized in that: The data processing process includes: Summarize and analyze data sources, extract types of work order data, and build required tags based on the types in the work order data. Then build customer portrait tags and filter out users with complaints.
3. The method for predicting electric power customer complaints based on the ADASYN-EAA-XGBoost algorithm according to claim 1, characterized in that: The power customer portrait labels include: (1) call trajectory, (2) call time span, (3) day of the week, (4) call month, (5) call frequency, (6) number of complaints, (7) average power outage complaint interval, (8) comprehensive sentiment score, and (9) power outage type consistency.
4. The method for predicting electric power customer complaints based on the ADASYN-EAA-XGBoost algorithm according to claim 1, characterized in that: The process of the ADASYN algorithm to balance the sample data positively and negatively includes: (1) Use the k-nearest neighbor method to calculate the density t of samples around the complaint customer category sample; (2) According to the value of t, calculate the number of synthetic samples that need to be generated, where the generation ratio is proportional to the density; (3) Generate a certain number of synthetic samples based on the calculated generation ratio. The characteristics of the synthetic samples are the weighted sum of the differences between the characteristics of the original samples and the characteristics of their nearest neighbor samples.
5. The method for predicting electric power customer complaints based on the ADASYN-EAA-XGBoost algorithm according to claim 1, characterized in that: The process of EAA algorithm weighting data samples in the data set includes: The constructed power customer image labels are given realistic weights, and then the labels are weighted using the entropy weight evaluation method. The comprehensive weights are calculated and the calculation formula for the comprehensive weights is obtained.
6. The method for predicting electric power customer complaints based on the ADASYN-EAA-XGBoost algorithm according to claim 1, characterized in that: The process of predicting the complaint tendency of power customers by using the extreme gradient boosting algorithm includes: (1) Divide the weighted data set into a training set and a validation set; (2) Establish an XGBoost algorithm model, use default model parameters, train the model parameters with the training set data set, and perform parameter tuning; (3) Use GridSearchCV to tune the model parameters and find the optimal parameters of the model; (4) The XGBoost algorithm with optimized parameters was used to establish a prediction model for power customer complaints, and the verification data set was used to predict the complaint tendency of power customers; (5) Finally, confusion matrix, ACC, Recall, Precision, F1-score, and running time are used to verify the superiority of the power customer complaint model.