Off-grid user prediction method, device, electronic device and storage medium
By using particle swarm algorithm to optimize parameters during the training of random forest model, the low prediction accuracy problem caused by improper setting of off-grid user prediction model parameters in the prior art is solved, and more accurate potential off-grid user prediction is achieved.
Patent Information
- Application Number
- CN202210388550.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-04-14
AI Technical Summary
In the prior art, the parameters of the off-grid user prediction model are usually set up based on experience or generated randomly, resulting in low prediction accuracy and insufficient potential off-grid users.
The particle swarm algorithm is used to optimize the parameters of the random forest model, and the optimized parameters are trained through the training data set to obtain a trained off-grid user prediction model with higher prediction accuracy.
The prediction accuracy of the off-grid user prediction model is improved, making the predicted potential off-grid users more accurate.
Smart Images

Figure CN114861986B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and in particular to a method, device, electronic device and storage medium for predicting off-grid users. Background Art
[0002] As competition in telecommunications services intensifies and user options increase, operator users are increasingly leaving the network. In order to reduce user churn, it is necessary to predict potential users who are inclined to leave the network in advance so as to implement retention policies for them.
[0003] In the prior art, a prediction model for off-grid users is trained by using user off-grid data samples, and then the off-grid user data to be predicted is input into the off-grid user prediction model, so as to output potential off-grid users using the off-grid user prediction model. The off-grid user prediction model mostly uses a random forest model, and the parameters of the random forest model are generally set based on experience or randomly generated, which makes the prediction accuracy of the final off-grid user prediction model not high enough, and the predicted potential off-grid users are not accurate enough.
[0004] Therefore, in the prior art, the parameters of the off-grid user prediction model are set based on experience or generated randomly, and the off-grid user prediction model is not accurate enough, resulting in inaccurate prediction of potential off-grid users using the off-grid user prediction model. Summary of the invention
[0005] The off-grid user prediction method, device, electronic device and storage medium provided in the present application are used to solve the problem that the off-grid user prediction model in the prior art is not accurate enough, resulting in inaccurate prediction of potential off-grid users using the off-grid user prediction model.
[0006] According to a first aspect of the present application, a method for predicting off-grid users is provided, comprising:
[0007] Acquire the data of users to be predicted to leave the network, and pre-process the data of users to be predicted to leave the network, so as to obtain the data set to be predicted;
[0008] The data set to be predicted is input into a trained off-grid user prediction model, and the trained off-grid user prediction model is used to output potential off-grid users among the off-grid users to be predicted. The trained off-grid user prediction model uses the training data set to train a random forest model, and a particle swarm algorithm is used to optimize the parameters of the random forest model when training the random forest model.
[0009] Furthermore, before inputting the data set to be predicted into the trained off-network user prediction model and using the trained off-network user prediction model to determine and output whether the user to be predicted is a potential off-network user, the method further includes:
[0010] Acquire a user off-network data sample, wherein the user off-network data sample includes at least one user off-network indicator;
[0011] Preprocessing the user off-network data samples to obtain a training data set and a test data set;
[0012] The training data set is used to train the random forest model, and the test data set is used to test the prediction accuracy of the trained random forest model;
[0013] When the prediction accuracy is less than the preset prediction accuracy, a particle swarm algorithm is used to optimize the parameters of the random forest model;
[0014] If it is determined that the trained random forest model meets the convergence condition, the random forest model corresponding to the convergence condition is determined as the trained off-grid user prediction model.
[0015] Further, obtaining the user off-network data sample includes:
[0016] Using web crawler technology, crawling the value of each user off-line indicator of at least one user on the Internet;
[0017] Each user off-line indicator of at least one user and a value of each user off-line indicator are determined as a user off-line data sample.
[0018] Furthermore, the preprocessing of the user off-network data samples to obtain a training data set and a test data set includes:
[0019] Filling the missing value of the off-line indicator of each sample in the user off-line data sample, wherein the missing value off-line indicator is a user off-line indicator with a missing value in the user off-line data sample;
[0020] A box graph analysis method is used to identify whether the user churn indicator value of each sample is abnormal, and samples corresponding to the user churn indicator with abnormal values in the user churn data samples are deleted;
[0021] A first preset proportion of data in the user off-network data sample is determined as a training data set, and a second preset proportion of data in the user off-network data sample is determined as a test data set.
[0022] Furthermore, the filling of the missing value of the off-line indicator of each sample in the user off-line data sample, wherein the missing value off-line indicator is a user off-line indicator with a missing value in the user off-line data sample, includes:
[0023] Obtain historical user off-network data samples;
[0024] Determine whether there is a historical value of the missing off-network indicator in the historical user off-network data sample;
[0025] If it is determined that there is a historical value of the missing off-network indicator in the historical user off-network data sample, the historical value is used to fill the value of the missing off-network indicator.
[0026] Further, the filling of the value of the missing off-network indicator of each sample in the user off-network data sample, wherein the missing off-network indicator is a user off-network indicator with a missing value in the user off-network data sample, further includes:
[0027] If it is determined that the historical value of the missing-value off-network indicator does not exist in the historical user off-network data samples, the sample to which the missing-value off-network indicator belongs is deleted from the user off-network data samples.
[0028] Further, the box graph analysis method is used to identify whether the user churn index value of each sample is abnormal, and the samples corresponding to the user churn index with abnormal values in the user churn data samples are deleted, including:
[0029] Determine whether the value of each user's off-line indicator is within a preset value range of each user's off-line indicator;
[0030] If the value of any user off-line indicator is not within the preset value range of each indicator, it is identified as an abnormal value of the user off-line indicator, and the sample corresponding to the user off-line indicator with the abnormal value in the user off-line data sample is deleted.
[0031] Furthermore, the preset numerical range of each user off-line indicator is [U+1.5IQR, L-1.5IQR], wherein U is the upper quartile of the numerical value of each user off-line indicator, L is the lower quartile of the numerical value of each user off-line indicator, and IQR is the difference between the upper quartile and the lower quartile of the numerical value of each user off-line indicator.
[0032] Furthermore, after the box graph analysis method is used to identify whether the user churn index value of each sample is abnormal, and the samples corresponding to the user churn index with abnormal values in the user churn data samples are deleted, the method further includes:
[0033] The user retention ratio is corrected according to the 3G data traffic, 4G data traffic and 5G data traffic, and the 3G data traffic, 4G data traffic, 5G data traffic and user retention ratio are all user off-network indicators.
[0034] Furthermore, when the prediction accuracy is less than a preset prediction accuracy, a particle swarm algorithm is used to optimize the parameters of the random forest model, including:
[0035] Using the training data set to train at least two candidate random forest models, the candidate random forest models include parameters to be optimized, and the parameters to be optimized include the number of decision trees and the number of characteristic attributes of the decision trees;
[0036] Use the test data set to test the prediction accuracy of the candidate random forest model;
[0037] Fit the functional relationship between the prediction accuracy of at least two candidate random forest models and the parameters to be optimized, and use it as the fitness function of the particle swarm algorithm;
[0038] The value of the parameter to be optimized when the fitness function value is maximum is determined as the optimized parameter to be optimized.
[0039] According to a second aspect of the present application, there is provided an off-grid user prediction device, comprising:
[0040] An acquisition module is used to acquire the to-be-predicted off-network user data and pre-process the to-be-predicted off-network user data to obtain a to-be-predicted data set;
[0041] The prediction module is used to input the data set to be predicted into the trained off-grid user prediction model, and use the trained off-grid user prediction model to determine and output whether the user to be predicted is a potential off-grid user. The trained off-grid user prediction model is obtained by training a random forest model using a training data set, and a particle swarm algorithm is used to optimize the parameters of the random forest model when training the random forest model.
[0042] According to a third aspect of the present application, there is provided an electronic device, comprising: a memory and a processor;
[0043] The memory and the processor circuit are interconnected;
[0044] The memory stores computer-executable instructions;
[0045] The processor executes the computer-executable instructions stored in the memory to implement the method as described in the first aspect.
[0046] According to a fourth aspect of the present application, a computer-readable storage medium storing computer-executable instructions is provided, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0047] The off-grid user prediction method, device, electronic device and storage medium provided in the present application obtain the off-grid user data to be predicted, and pre-process the off-grid user data to be predicted to obtain the data set to be predicted; input the data set to be predicted into the trained off-grid user prediction model, and use the trained off-grid user prediction model to output the potential off-grid users among the off-grid users to be predicted, the trained off-grid user prediction model uses the training data set to train the random forest model, and uses the particle swarm algorithm to optimize the parameters of the random forest model when training the random forest model. The trained off-grid user prediction model is obtained by training the random forest model with the training data set, and optimizing the parameters of the random forest model with the particle swarm algorithm during training. The model corresponding to the optimized parameters has a higher prediction accuracy, so the trained off-grid user prediction model is more accurate, and thus, the potential off-grid users predicted by the trained off-grid user prediction model can be more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0049] Figure 1 It is a network architecture corresponding to an application scenario provided by an embodiment of the present application;
[0050] Figure 2 It is a schematic diagram of the flow of the off-network user prediction method provided according to the first embodiment of the present application;
[0051] Figure 3 is a schematic diagram of the flow of the off-network user prediction method provided according to the second embodiment of the present application;
[0052] Figure 4 is a schematic diagram of the flow of an off-grid user prediction method provided according to the third embodiment of the present application;
[0053] Figure 5 is a flowchart of a method for predicting off-grid users provided in accordance with the fourth embodiment of the present application;
[0054] Figure 6 is a schematic diagram of the flow of an off-network user prediction method provided according to the fifth embodiment of the present application;
[0055] Figure 7 is a flowchart of a method for predicting off-grid users provided according to a sixth embodiment of the present application;
[0056] Figure 8 is a schematic diagram of the structure of an off-grid user prediction device provided according to the seventh embodiment of the present application;
[0057] Fig. 9This is a block diagram of an electronic device provided according to the eighth embodiment of the present application.
[0058] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0059] First, the prior art involved in this application is described and analyzed in detail.
[0060] In the prior art, an off-grid user prediction model is often used to predict potential off-grid users with a tendency to leave the grid. The off-grid user prediction model generally adopts a random forest model, and is obtained by training the random forest model using user off-grid data samples. Since the parameters of the random forest model are set based on experience or randomly generated, and the parameters of the model are one of the factors affecting the prediction accuracy of the model, the model corresponding to the parameters set based on experience or randomly generated often does not obtain a high prediction accuracy after training. In the prior art, the parameters of the model are generally adjusted based on experience or randomly adjusted in order to improve the prediction accuracy of the model. However, after the parameter adjustment, the model needs to be retrained and tested to obtain whether the model corresponding to the adjusted parameters has a higher prediction accuracy, and the model corresponding to the adjusted parameters may not necessarily have a higher prediction accuracy. In summary, the off-grid user prediction model in the prior art is not accurate enough, resulting in the potential off-grid users predicted by the off-grid user prediction model being not accurate enough.
[0061] Therefore, when faced with the problems in the prior art, the inventors discovered through creative research that in order to improve the prediction accuracy of the off-grid user prediction model, when training the random forest model, the particle swarm algorithm is used to optimize the parameters of the random forest model, and then the training data set is used to train the random forest model corresponding to the optimized parameters. Since the random forest model corresponding to the optimized parameters has a higher prediction accuracy, the training data is used to train the random forest model corresponding to the optimized parameters, so that a trained off-grid user prediction model with a higher prediction accuracy can be obtained. The trained off-grid user prediction model is then used to predict the off-grid user data to be predicted, and the predicted potential off-grid users can be more accurate.
[0062] Based on the above creative discovery, the inventor proposes the solution of the present application. The network architecture and application scenarios of the off-grid user prediction method provided by the embodiment of the present application are introduced below. When the following description refers to the drawings, unless otherwise indicated, the same data in different drawings represent the same or similar elements.
[0063] like Figure 1 As shown, a network architecture corresponding to an application scenario provided by an embodiment of the present application includes: a user terminal 1, an electronic device 2 and a database 3, a client 10 equipped with an off-network user prediction application software in the user terminal 1 or a website of an off-network user prediction method accessed by the user terminal. The user terminal 1, the electronic device 2 and the database 3 are in communication connection. The database 3 stores user off-network data samples. The electronic device 2 is configured with a trained off-network user prediction model.
[0064] In one application scenario, the user inputs the off-grid user data to be predicted through the operation interface of the client 10 or the web page corresponding to the URL. The user terminal 1 sends the off-grid user data to be predicted input by the user to the electronic device 2, and the electronic device 2 obtains the off-grid user data to be predicted, and pre-processes the off-grid user data to be predicted to obtain a data set to be predicted. The electronic device 2 inputs the data set to be predicted into the trained off-grid user prediction model, and uses the trained off-grid user prediction model to output potential off-grid users among the off-grid users to be predicted, and sends the potential off-grid users to the user terminal 1. The user terminal 1 can display the potential off-grid users among the off-grid users to be predicted, for example, displaying the potential off-grid users in the client operation interface or web page of the off-grid user prediction application software, so that the user can view the potential off-grid users.
[0065] The electronic device 2 can communicate with the database 3 to obtain the user off-network data samples stored in the database 3. The user off-network data samples can be captured by the electronic device 2 on the Internet and stored in the database 3. The electronic device 2 preprocesses the off-network user data samples to obtain a training data set and a test data set. The electronic device 2 uses the training data set to train the random forest model, and uses the test data set to test the prediction accuracy of the trained random forest model; and when the prediction accuracy is less than the preset prediction accuracy, the particle swarm algorithm is used to optimize the parameters of the random forest model; if it is determined that the trained random forest model meets the convergence condition, the random forest model corresponding to the convergence condition is determined as the trained off-network user prediction model.
[0066] The embodiments of the present application will be described below in conjunction with the accompanying drawings. The embodiments described in the following embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0067] Embodiment 1
[0068] Figure 2 is a flow chart of the off-network user prediction method provided according to the first embodiment of the present application, such as Figure 2As shown, the execution subject of the present application is an off-network user prediction device, and the off-network user prediction device is located in an electronic device. The off-network user prediction method provided in this embodiment includes steps 201 to 202.
[0069] Step 201 : obtaining the to-be-predicted off-network user data, and preprocessing the to-be-predicted off-network user data to obtain the to-be-predicted data set.
[0070] In this embodiment, the user using the off-network user prediction method provided in this embodiment may be a network operator, a staff of a network operator, etc., hereinafter referred to as an operator. The off-network user to be predicted may be a user who is using the operator's network (i.e., an online user of the network operator). The off-network user data to be predicted may include at least one of the user off-network indicators such as customer complaint data (e.g., the comprehensive satisfaction index TCSI of the Ministry of Industry and Information Technology), customer effort CES, net recommendation value NPS, and network data.
[0071] In this embodiment, a trained off-network user prediction model is configured on the electronic device. The operator can access the website of the off-network user prediction method through the client of the off-network user prediction application software installed on the user terminal or the user terminal, and input the off-network user data to be predicted in the operation interface of the client or the web page corresponding to the website. The user terminal can communicate with the electronic device and send the off-network user data to be predicted to the electronic device, so that the electronic device obtains the off-network user data to be predicted.
[0072] In this embodiment, the customer complaint data may be the Tier Customer Satisfaction Index (TCSI) of the Ministry of Industry and Information Technology. TCSI is conducted by an agency under the Ministry of Industry and Information Technology using outbound calls based on the tail number rules to survey four user groups: mobile phones, mobile 5G users, fixed Internet access (broadband), and fixed voice (landline). The survey evaluates users' satisfaction with voice quality, Internet access quality, publicity and promotion, package rules, understanding of consumption, channel services, and overall perception.
[0073] Customer Effort Score (CES) is an extension of customer satisfaction. It measures the effort required to meet user desires and needs, and can more fully evaluate user experience.
[0074] Net Promoter Scores (NPS) are indicators that measure "customers' tendency to recommend a brand / product / service to others". They are the core indicators used internationally to measure customer behavioral loyalty. In essence, they are a kind of customer word-of-mouth and behavioral loyalty. Customers are asked to score between [0, 10] according to their willingness to recommend, and three types of customers are judged based on the scores: Promoters (scores between [9, 10]) are fanatically loyal people who will continue to buy and recommend to others; Passives (scores between [7, 8]) are generally satisfied but not fanatical, and will consider other competitors' products; Detractors (scores between [0, 6]) are not satisfied with the use or have no loyalty.
[0075] Network data refers to the objective network conditions when users use the operator's network, which may include user data traffic, MR coverage, user retention ratio, etc.
[0076] User data traffic refers to the data traffic generated by accessing the Internet or using related data value-added services through mobile communication technologies such as General Global System for Mobile Communications (GSM), wireless packet service (GPRS), enhanced data rate for GSM evolution (EDGE), time division synchronous code division multiple access (TD-SCDMA), high-speed downlink data packet access (HSDPA), wideband code division multiple access (WCDMA), and long term evolution (LTE).
[0077] MR coverage rate: refers to the proportion of sampling points with RSRP ≥ -110dBm in the MR sampling data that are actively discovered through big data operations in the background by locating all mobile phones in a certain area through base stations, continuously collecting the strength change status and location status of mobile phone signals. MR refers to the report file generated by the base station or terminal based on a certain period or event trigger report. The LTE system MR data file types include MRO, MRE and MRS. In fact, MRO is a periodic measurement report sample data file that does not contain trigger-type time sample data; MRE is time-triggered measurement report sample data; MRS is a measurement report statistical data file based on MRO sample data. MR coverage rate is the proportion of sampling points with RSRP ≥ -110dBm in the MR sampling data to all sampling points.
[0078] The user retention ratio refers to the ratio of any network standard (3G, 4G, 5G traffic) generated by a user to all traffic generated by the user. All traffic generated by the user includes the 5G traffic, 4G traffic and 3G traffic generated by the user. The user retention ratio is used to evaluate the coverage of a certain network standard.
[0079] In this embodiment, the preprocessing of the predicted off-network user data may be to delete duplicate values in the predicted off-network user data and convert the predicted off-network user data into a matrix to obtain a test data set. Exemplarily, the predicted off-network user data includes the following four user off-network indicators for n users: MIIT's comprehensive satisfaction index TCSI, customer effort CES, net recommendation value NPS, and user retention ratio. And the TCSI, CES, NPS, and user retention ratio of the i-th user are respectively Then the test data set M is expressed as:
[0080] In step 202, the data set to be predicted is input into the trained off-grid user prediction model, and the trained off-grid user prediction model is used to determine and output whether the user to be predicted is a potential off-grid user. The trained off-grid user prediction model is obtained by training a random forest model using the training data set, and a particle swarm algorithm is used to optimize the parameters of the random forest model when training the random forest model.
[0081] In this embodiment, the user churn index of each user in the data set to be predicted can be brought into each decision tree of the trained churn user prediction model, and each decision tree is used to predict whether the user is a potential churn user according to the user churn index of each user, and the prediction results of all decision trees are used in a minority-subordinates-majority manner to determine whether the user is a potential churn user. The specific implementation principle is the implementation principle of the random forest algorithm, which will not be described in detail here.
[0082] The off-network user prediction method provided in this embodiment obtains the off-network user data to be predicted, and pre-processes the off-network user data to be predicted to obtain a data set to be predicted; the data set to be predicted is input into a trained off-network user prediction model, and the trained off-network user prediction model is used to output potential off-network users among the users to be predicted, and the trained off-network user prediction model is obtained by training a random forest model using a training data set, and a particle swarm algorithm is used to optimize the parameters of the random forest model when training the random forest model. Since the off-network user data to be predicted is pre-processed, the obtained data set to be predicted can be made more accurate, and the trained off-network user prediction model is obtained by training the random forest model using a training data set, and the parameters of the random forest model are optimized by a particle swarm algorithm during training, and has a higher accuracy rate, so the data set to be predicted is input into the trained off-network user prediction model, and the trained off-network user prediction model is used to output potential off-network users among the off-network users to be predicted, and the predicted potential off-network users can be more accurate.
[0083] Embodiment 2
[0084] Figure 3: is a flow chart of a method for predicting off-grid users provided in accordance with the second embodiment of the present application. Figure 3 As shown, the off-grid user prediction method provided in this embodiment, based on the first embodiment, also includes a step of training the random forest model before step 202, which can be specifically steps 301 to 305.
[0085] Step 301: Acquire a user off-network data sample, where the user off-network data sample includes at least one user off-network indicator.
[0086] In this embodiment, the user off-network indicator in the user off-network data sample includes at least the user network indicator in the to-be-predicted off-network user data. The user off-network data sample may include off-network users and online users, and it is known whether the user in the user off-network data sample is an off-network user or an online user.
[0087] Step 302: pre-process the user off-network data samples to obtain a training data set and a test data set.
[0088] In this embodiment, the method for preprocessing the user off-network data samples can be the same as the method for preprocessing the predicted off-network user data. Specifically, the user off-network data samples can also be preprocessed using conventional data cleaning methods, for example, filling in the missing values of the samples, deleting samples with too many missing values, etc.
[0089] In this embodiment, 75% of the user off-network data samples after preprocessing can be determined as a training data set, and another 25% of the user off-network data samples after preprocessing can be determined as a test data set. For example, Python can be used for analysis, pandas and numpy toolkits can be imported, and train_test_split can be used to split the data set into a training set and a test set. Test_size = 0.25, that is, 75% is used as a training set and 25% is used as a test set.
[0090] Optionally, the pre-processed user churn data samples may be standardized to control the values of different user churn indicators within a certain range so that different user churn indicators have the same scale to eliminate differences between user churn indicators.
[0091] Step 303: Use the training data set to train the random forest model, and use the test data set to test the prediction accuracy of the trained random forest model.
[0092] In this embodiment, n user off-network data samples can be randomly selected with replacement from the training data set, and then k indicators can be randomly selected from the user off-network indicators as the characteristic attributes of the decision tree, and the selected k user off-network indicators can be used to construct a decision tree with k characteristic attributes corresponding to the n user off-network data samples. Repeat the above steps m times to establish m decision trees, and determine the set of m decision trees as the trained random forest model. The test data set is input into the trained random forest model, and the trained random forest model is used to output the potential off-network users in the test data set, and the proportion of the number of potential off-network users in the output test data set that are already off-network users (i.e., the number of accurate predictions) to the total users in the test data set is determined as the prediction accuracy of the random forest model.
[0093] Step 304: When the prediction accuracy is less than the preset prediction accuracy, the particle swarm algorithm is used to optimize the parameters of the random forest model.
[0094] In this embodiment, the preset prediction accuracy can be the prediction accuracy expected by the operator. If the prediction accuracy of the trained random forest model is less than the preset prediction accuracy, it means that the prediction accuracy of the model does not meet the expectations of the operator, and the parameters of the model need to be optimized in order to obtain a higher accuracy. Specifically, the functional relationship between the parameters of the random forest model and the prediction accuracy can be fitted, and the particle swarm algorithm is used to obtain the random forest model parameter value corresponding to the highest prediction accuracy, and the parameter value of the random forest model corresponding to the highest prediction accuracy is determined as the parameter value of the optimized random forest model. The training data set is used to train the random forest model corresponding to the optimized parameters, and the trained random forest model is obtained again. The prediction accuracy of the trained random forest model is tested again using the test data set. If the prediction accuracy is still less than the preset prediction accuracy, the functional relationship between the parameters and the prediction accuracy of the two random forest models can be fitted again. Since there are more data on the independent variables and the dependent variables, a more accurate functional relationship between the parameters and the prediction accuracy of the random forest model can be fitted. The particle swarm algorithm is used again to obtain the random forest model parameter value corresponding to the highest prediction accuracy, and the parameter value of the random forest model corresponding to the highest prediction accuracy is determined as the parameter value of the optimized random forest model. Repeat the above steps until the random forest model corresponding to the optimized parameters is trained with the training data set, and the prediction accuracy tested with the test data set is greater than or equal to the preset prediction accuracy. In this embodiment, the method of optimizing the parameters of the random forest model using the particle swarm algorithm is not limited.
[0095] Step 305: If it is determined that the trained random forest model meets the convergence condition, the random forest model corresponding to the convergence condition is determined as the trained off-grid user prediction model.
[0096] In this embodiment, the convergence condition may be pre-set, and the convergence condition may include a preset prediction accuracy rate. For example, the trained random forest model satisfies the convergence condition when the prediction accuracy rate of the trained random forest model is greater than or equal to the preset accuracy rate. Optionally, the convergence condition may also include a pre-set prediction time, and the prediction time may reflect the speed at which the random forest model predicts potential off-network users among the off-network users to be predicted.
[0097] The off-network user prediction method provided in this embodiment obtains user off-network data samples, and the user off-network data samples include at least one user off-network indicator; pre-processes the user off-network data samples to obtain a training data set and a test data set; uses the training data set to train the random forest model, and uses the test data set to test the prediction accuracy of the random forest model; when the prediction accuracy is less than the preset prediction accuracy, the particle swarm algorithm is used to optimize the parameters of the random forest model; if it is determined that the trained random forest model meets the convergence condition, the random forest model corresponding to the convergence condition is determined as the trained off-network user prediction model. Due to the pre-processing of the user off-network data samples, more accurate user off-network data samples can be obtained. When the prediction accuracy is less than the preset prediction accuracy, the particle swarm algorithm is used to optimize the parameters of the random forest model. The random forest model corresponding to the optimized parameters can have a higher prediction accuracy. The convergence condition can be that the prediction accuracy of the random forest model meets the preset prediction accuracy. Therefore, the random forest model corresponding to the convergence condition is determined as the trained off-network user prediction model, and the trained off-network user prediction model can have a higher accuracy.
[0098] As an optional implementation, based on the second embodiment, step 301 is refined, and step 301 is refined to include steps 3011 to 3012.
[0099] Step 3011, using web crawler technology to crawl the values of each user off-line indicator of at least one user on the Internet.
[0100] In this embodiment, a Java-based Heritrix framework can be built to crawl at least one of the user off-network indicators such as customer complaint data, customer effort CES, net recommendation value NPS, and network data on the big data platform. The big data platform can be a data platform owned by the operator or a data platform provided by a third party. The big data platform includes customer complaint data, customer effort data, net recommendation value, and network data of the operator's off-network users and on-network users. Heritrix is an open source web crawler developed by Java and used to crawl required data from the Internet.
[0101] Step 3012: Determine each user off-line indicator of at least one user and the value of each user off-line indicator as a user off-line data sample.
[0102] In this embodiment, generally speaking, the more user off-network data samples there are, the higher the prediction accuracy of the trained random forest model, but the longer the time required to train the model. However, too many user off-network data samples will cause overfitting of the random forest model, which will reduce the prediction accuracy of the model. In this embodiment, the number of user off-network data samples can be preset based on experience, and the user off-network indicators of the users with the preset number of user off-network data samples in the captured data and the values of each user off-network indicator are determined as user off-network data samples. In this embodiment, data analysis software can be used to integrate the data captured on the Internet, export data sets of each user off-network indicator, such as data sets in SAS format, and merge the data sets of each user off-network indicator into an Excel file to obtain user off-network data samples.
[0103] The off-network user prediction method provided in this embodiment uses web crawler technology to crawl the values of each user off-network indicator of at least one user on the Internet; and determines each user off-network indicator of at least one user and the values of each user off-network indicator as a user off-network data sample. Since the values of each user off-network indicator of the user are crawled by web crawler technology, it can be guaranteed that the latest values of each user off-network indicator are obtained, so the accuracy of the user off-network indicator values in the user off-network data sample can be improved, and determining each user off-network indicator of at least one user and the values of each user off-network indicator as the user off-network data sample can control the number of samples, thereby improving the prediction accuracy of the trained off-network user prediction model.
[0104] Embodiment 3
[0105] Figure 4 : is a flow chart of a method for predicting off-grid users provided in accordance with the third embodiment of the present application. Figure 4 As shown, the off-grid user prediction method provided in this embodiment refines step 302 on the basis of embodiment 1 or embodiment 2, and step 302 is refined to include steps 401 to 403.
[0106] Step 401, fill in the value of the missing off-network indicator of each sample in the user off-network data sample, where the missing off-network indicator is the user off-network indicator with a missing value in the user off-network data sample.
[0107] In this embodiment, the user off-line data sample includes at least one sample, and one sample is each user off-line indicator of a user and its value (i.e., indicator value). Specifically, a multiple filling method can be used to determine the value of the missing off-line indicator according to the value of the missing off-line indicator in the remaining user samples that do not lack the user off-line value value. Exemplarily, the user off-line data sample includes each user off-line indicator of 30 users, and the CES value is missing in each user off-line indicator of one user, then the missing CES value can be determined according to the remaining 29 non-missing CES values. Exemplarily, the R voice can be used to judge the value of the missing off-line indicator in the user off-line data sample, for example, calling the mice function, and selecting the bootstrap linear regression (norm.boot) method as the methods interpolation method to achieve the filling of missing values.
[0108] Step 402: Use a box graph analysis method to identify whether the user churn indicator value of each sample is abnormal, and delete the samples corresponding to the user churn indicator with abnormal value in the user churn data samples.
[0109] In this embodiment, the percentage of the normal range of values of each user off-line indicator in the box plot analysis method can be preset, and the lower limit of the normal range of values is 0% and the upper limit is 100%. The user off-line indicator values of each sample are sorted in order from large to small, and the position of the user off-line indicator value of each sample in the sequence is determined, for example, the first 25%. Values greater than the upper limit of the normal range are determined as abnormal, and values less than the lower limit of the normal range are determined as abnormal. Delete the samples corresponding to the user off-line indicators with abnormal values in the user off-line data samples.
[0110] Step 403: determine a first preset proportion of data in the user offline data sample as a training data set, and determine a second preset proportion of data in the user offline data sample as a test data set.
[0111] In this embodiment, the training data set is data used to train the random forest model, and the test data set is data used to test the prediction accuracy of the trained random forest model. The data in the training data set and the data in the test data set may not overlap with each other. The sum of the first preset ratio and the second preset ratio may be 1.
[0112] As an optional implementation, based on the third embodiment, the method may further include the step of: using a multi-linear regression method to eliminate data noise of user off-network data samples.
[0113] Specifically, a multi-linear regression method can be used to establish a regression model, fit a smooth curve of each user's off-grid indicator, and eliminate the data noise of each user's off-grid indicator. For example, the smooth curve can be fitted through the curve fitting program plot(t,y_fitting,'r-',t,Y(t,:),'b-',t,abs(y_fitting-Y(t,:)),'k-') in matlab to eliminate data noise.
[0114] The off-network user prediction method provided in this embodiment fills in the missing off-network indicator values of each sample in the user off-network data sample, where the missing off-network indicator is the user off-network indicator that is missing a value in the user off-network data sample; uses a box plot analysis method to identify whether the value of each user off-network indicator is abnormal, and deletes the user off-network indicator with abnormal values in the user off-network data; determines the first preset proportion of data in the user off-network data sample as a training data set, and determines the second preset proportion of data in the user off-network data sample as a test data set. Since the user off-network data samples are filled, the box plot analysis method is used to identify whether the value is abnormal and delete the abnormal value, so a more accurate user off-network data sample can be obtained, and then a more accurate trained off-network user prediction model can be obtained.
[0115] As an optional implementation, based on any of the above embodiments, step 402 further includes step 4021.
[0116] Step 4021, correcting the user retention ratio according to the 3G data traffic, 4G data traffic and 5G data traffic, where the 3G data traffic, 4G data traffic, 5G data traffic and the user retention ratio are all indicators of user leaving the network.
[0117] In this embodiment, since the traffic types currently used by users are mostly 4G and 5G, it will not be accurate enough to only consider the coverage of 4G or 5G network standards. Therefore, the user residence ratio is corrected according to 3G data traffic, 4G data traffic and 5G data traffic. The corrected user residence ratio = (4G data traffic + 5G data traffic) / (3G data traffic + 4G data traffic + 5G data traffic) * 100%.
[0118] The off-network user prediction method provided in this embodiment corrects the user retention ratio according to 3G data traffic, 4G data traffic and 5G data traffic. 3G data traffic, 4G data traffic, 5G data traffic and user retention ratio are all user off-network indicators. Since the corrected user retention ratio is more in line with the actual usage of current users, a more accurate user off-network data sample can be obtained.
[0119] Embodiment 4
[0120] Figure 5 : is a flow chart of a method for predicting off-grid users provided in accordance with the fourth embodiment of the present application. Figure 5 As shown, the off-grid user prediction method provided in this embodiment refines step 401 on the basis of the third embodiment, and step 401 is refined to include steps 501 to 503.
[0121] Step 501, obtaining historical user off-network data samples.
[0122] In this embodiment, the electronic device may store each acquired user off-line data sample in a database, and communicate with the database when necessary to acquire historical user off-line data samples. The historical user off-line data samples include at least one historical sample, and the historical sample is each off-line index of the user and its value. The historical samples in the historical off-line data samples and the samples in the user off-line data samples may be each user off-line index and its value of the same user at different times, and the historical off-line data samples and the user off-line data samples may also include different users.
[0123] Step 502: determine whether there is a missing historical value of the off-line indicator in the historical user off-line data sample.
[0124] In this embodiment, when a sample in the user off-network data samples has a missing off-network indicator, it can be checked whether the sample has a historical value for the missing off-network indicator in the historical user off-network data samples.
[0125] Step 503: If it is determined that there are missing historical values of the off-line indicator in the historical user off-line data sample, the missing values of the off-line indicator are filled with the historical values.
[0126] In this embodiment, if it is determined that the missing off-network indicator of the sample has a historical value in the historical user off-network data sample, the historical value can be used to fill the missing off-network indicator value of the sample.
[0127] The off-network user prediction method provided in this embodiment obtains historical user off-network data samples; determines whether there are missing historical values of off-network indicators in the historical user off-network data samples; if it is determined that there are missing historical values of off-network indicators in the historical user off-network data, the missing values of off-network indicators are filled with historical values. Since the missing values of off-network indicators are filled with historical values of off-network indicators, more accurate user off-network data samples can be obtained.
[0128] In this embodiment, if it is determined that there is no historical value of the missing off-network indicator in the historical user off-network data sample, step 504 can be executed. As an optional implementation, based on embodiment 4, step 401 is further refined to include step 504.
[0129] Step 504: If it is determined that there is no historical value of the missing-value off-network indicator in the historical user off-network data samples, the sample to which the missing-value off-network indicator belongs is deleted from the user off-network data samples.
[0130] In this embodiment, if it is determined that the missing value off-network indicator of the sample in the historical user off-network data does not have a historical value, it may be that the sample to which the missing value off-network indicator belongs does not exist in the historical user off-network data samples, or it may be that the sample to which the missing value off-network indicator belongs exists in the historical user off-network data samples, but the sample to which the missing value off-network indicator belongs does not have a historical value of the missing value off-network indicator. At this time, in order to ensure the integrity of the user off-network data, the sample to which the missing value off-network indicator belongs may be deleted from the user off-network data samples.
[0131] The off-grid user prediction method provided in this embodiment deletes the samples to which the missing off-grid indicators belong from the user off-grid data samples if it is determined that there are no historical values of the missing off-grid indicators in the historical user off-grid data samples. Since the samples to which the missing off-grid indicators belong cannot be filled with historical values, the integrity of the user off-grid indicator samples can be improved, and more accurate user off-grid data samples can be obtained.
[0132] Embodiment 5
[0133] Figure 6 is a flow chart of a method for predicting off-network users according to the fifth embodiment of the present application. Figure 6 As shown, the off-grid user prediction method provided in this embodiment is based on any of the above embodiments, and step 402 is refined, and step 402 is refined to include steps 601 to 602.
[0134] Step 601, determining whether the value of each user's off-line indicator is within a preset value range of each user's off-line indicator.
[0135] In this embodiment, the preset value range of each user off-line indicator may be [25%, 75%] of the maximum value of each user off-line indicator.
[0136] Step 602: If the value of any user off-line indicator is not within the preset value range of each indicator, it is identified as an abnormal value of the user off-line indicator, and the sample corresponding to the abnormal user off-line indicator in the user off-line data sample is deleted.
[0137] In this embodiment, it can be determined whether the value of each user off-line indicator in the user off-line data sample is within the preset value range of the indicator. If it is determined that the value of the indicator is not within the preset value range of the indicator, it is identified as an abnormal value of the user off-line indicator, and all samples in the user off-line data sample and the user off-line indicators of all samples are traversed to determine the samples corresponding to all user off-line indicators with abnormal values, and the samples corresponding to the user off-line indicators with abnormal values of the user off-line data sample are deleted to obtain a more accurate user off-line data sample.
[0138] In this embodiment, if it is determined that the value of any user off-line indicator is within the preset value range of the indicator, the process ends and step 403 can be executed to determine the first preset proportion of data in the user off-line data sample as the training data set, and determine the second preset proportion of data in the user off-line data sample as the test data set.
[0139] The off-network user prediction method provided in this embodiment determines whether the value of each user off-network indicator is within the preset value range of each user off-network indicator. If the value of any user off-network indicator is not within the preset value range of each indicator, it is identified as an abnormal value of the user off-network indicator, and the samples corresponding to the user off-network indicators with abnormal values in the user off-network data samples are deleted. Since the samples corresponding to the user off-network indicators with abnormal values in the user off-network data samples are deleted, more accurate user off-network data samples can be obtained.
[0140] As an optional implementation, based on Example 5, the preset numerical range of each user's off-line indicator is [U+1.5IQR, L-1.5IQR], wherein U is the upper quartile of the numerical value of each user's off-line indicator, L is the lower quartile of the numerical value of each user's off-line indicator, and IQR is the difference between the upper quartile and the lower quartile of the numerical value of each user's off-line indicator.
[0141] In this embodiment, the upper quartile U indicates that only 1 / 4 of all samples have a user churn index value greater than U, that is, when the values of the user churn index values in all samples are sorted from large to small, U is the user churn index value at 25%. The lower quartile L indicates that only 1 / 4 of all samples have a user churn index value less than L, that is, when the values of the user churn index values in all samples are sorted from large to small, L is the user churn index value at 75%. The median Q represents a number in the middle position of a group of numbers arranged from large to small. If the number of sequences is an even number, the median of the group of numbers is the average of the two middle numbers. Interquartile range IQR = UL.
[0142] In this embodiment, by presetting the value range of each user off-line indicator as [U+1.5IQR, L-1.5IQR], it is possible to more accurately identify abnormal data values of the user off-line indicators, so that a more accurate user off-line data sample can be obtained.
[0143] Embodiment 6
[0144] Figure 7 : is a flow chart of a method for predicting off-grid users provided in accordance with the sixth embodiment of the present application. Figure 7 As shown, the off-grid user prediction method provided in this embodiment is based on any of the above embodiments, and step 304 is refined, and the refinement of step 304 includes steps 701 to 704.
[0145] Step 701: Use a training data set to train at least two candidate random forest models, where the candidate random forest models include parameters to be optimized, and the parameters to be optimized include the number of decision trees and the number of characteristic attributes of the decision trees.
[0146] In this embodiment, two random forest models can be randomly generated, and the random forest models include parameters to be optimized, and the parameters to be optimized can also be randomly generated. The two random forest models are trained respectively using the training data set to obtain two candidate random forest models.
[0147] In this embodiment, when the training data set is used to train the random forest model, the importance of each user churn indicator can be quantified. The importance of each user churn indicator can be the Gini coefficient of each user churn indicator. An importance threshold can be set in advance, and the user churn indicators with an importance less than the importance threshold in the user churn data sample are discarded, and the remaining user churn indicators with an importance greater than the importance threshold in the user churn data sample are selected to train the random forest model.
[0148] Step 702: Use a test data set to test the prediction accuracy of the candidate random forest model.
[0149] In this embodiment, the prediction accuracy of the two candidate random forest models can be tested using a test data set, that is, the samples in the test data set are input into the two candidate random forest models respectively, and the two candidate random forest models are used to output the potential off-network users in the test data set, and the prediction accuracy of the two candidate random forest models is calculated.
[0150] Step 703: Fit the functional relationship between the prediction accuracy of at least two candidate random forest models and the parameters to be optimized, and use it as the fitness function of the particle swarm algorithm.
[0151] In this embodiment, the parameters to be optimized of at least two candidate random forest models can be determined as independent variables, the prediction accuracy of at least two candidate random forest models can be determined as dependent variables, the functional relationship between the prediction accuracy and the parameters to be optimized can be fitted, and the functional relationship between the prediction accuracy and the parameters to be optimized can be used as the fitness function of the particle swarm algorithm.
[0152] Step 704: Determine the value of the parameter to be optimized when the fitness function value is maximum as the optimized parameter to be optimized.
[0153] In this embodiment, a particle swarm algorithm may be used to obtain the value of the parameter to be optimized when the fitness function value is maximum, and the value of the parameter to be optimized when the fitness function value is maximum is determined as the optimized parameter to be optimized.
[0154] The off-grid user prediction method provided in this embodiment trains at least two candidate random forest models by using a training data set, wherein the candidate random forest models include parameters to be optimized, and the parameters to be optimized include the number of decision trees and the number of characteristic attributes of the decision trees; the prediction accuracy of the candidate random forest models is tested by using a test data set; the functional relationship between the prediction accuracy and the parameters to be optimized of at least two candidate random forest models is fitted, and used as the fitness function of the particle swarm algorithm; the value of the parameter to be optimized when the fitness function value is the largest is determined as the optimized parameter to be optimized. Since the particle swarm algorithm is used to quickly obtain the value of the parameter to be optimized corresponding to the highest prediction accuracy, the prediction accuracy of the random forest model can be improved, thereby obtaining a trained off-grid user prediction model with a higher prediction accuracy.
[0155] Embodiment 7
[0156] Figure 8 is a schematic diagram of the structure of an off-network user prediction device according to the seventh embodiment of the present application. The off-network user prediction device provided in this embodiment is located in an electronic device, such as Figure 8 As shown, the off-grid user prediction device 80 includes an acquisition module 81 and a prediction module 82 .
[0157] The acquisition module 81 is used to acquire the to-be-predicted off-network user data and pre-process the to-be-predicted off-network user data to obtain the to-be-predicted data set.
[0158] The prediction module 82 is used to input the data set to be predicted into the trained off-grid user prediction model, and use the trained off-grid user prediction model to determine and output whether the user to be predicted is a potential off-grid user. The trained off-grid user prediction model uses the training data set to train the random forest model, and uses the particle swarm algorithm to optimize the parameters of the random forest model when training the random forest model.
[0159] As an optional implementation, the off-grid user prediction device 80 further includes a determination module. The determination module is used to obtain a user off-grid data sample, which includes at least one user off-grid indicator; pre-process the user off-grid data sample to obtain a training data set and a test data set; train the random forest model using the training data set, and test the prediction accuracy of the random forest model using the test data set; when the prediction accuracy is less than the preset prediction accuracy, optimize the parameters of the random forest model using a particle swarm algorithm; if it is determined that the trained random forest model meets the convergence condition, then determine the random forest model corresponding to the convergence condition as the trained off-grid user prediction model.
[0160] As an optional implementation, the determination module is specifically used to use web crawler technology to crawl the values of each user off-line indicator of at least one user on the Internet; and determine each user off-line indicator of at least one user and the value of each user off-line indicator as a user off-line data sample.
[0161] As an optional implementation, the determination module is also used to fill in the missing value of the off-line indicator of each sample in the user off-line data sample using a multiple filling method, where the missing value off-line indicator is the user off-line indicator that is missing a value in the user off-line data sample; use a box graph analysis method to identify whether the user off-line indicator value of each sample is abnormal, and delete the samples corresponding to the user off-line indicators with abnormal values in the user off-line data sample; determine a first preset proportion of data in the user off-line data sample as a training data set, and determine a second preset proportion of data in the user off-line data sample as a test data set.
[0162] As an optional implementation, the determination module is also used to obtain historical user off-grid data samples; determine whether there are historical values of missing off-grid indicators in the historical user off-grid data samples; if it is determined that there are historical values of missing off-grid indicators in the historical user off-grid data samples, use the historical values to fill in the values of the missing off-grid indicators.
[0163] As an optional implementation manner, the determination module is further configured to delete the sample to which the missing value off-line indicator belongs from the user off-line data sample if it is determined that there is no historical value of the missing value off-line indicator in the historical user off-line data sample.
[0164] As an optional implementation, the determination module is also used to determine whether the value of each user's off-line indicator is within the preset value range of each user's off-line indicator; if the value of any user's off-line indicator is not within the preset value range of each indicator, it is identified as an abnormal value of the user's off-line indicator, and the sample corresponding to the user's off-line indicator with the abnormal value in the user's off-line data sample is deleted.
[0165] As an optional implementation, the preset value range of each user off-line indicator is [U+1.5IQR, L-1.5IQR], wherein U is the upper quartile of the value of each user off-line indicator, L is the lower quartile of the value of each user off-line indicator, and IQR is the difference between the upper quartile and the lower quartile of the value of each user off-line indicator.
[0166] As an optional implementation, the determination module is also used to correct the user residence ratio according to 3G data traffic, 4G data traffic and 5G data traffic, and 3G data traffic, 4G data traffic, 5G data traffic and user residence ratio are all user off-network indicators.
[0167] As an optional implementation, the determination module is also used to train at least two candidate random forest models using a training data set, the candidate random forest models include parameters to be optimized, and the parameters to be optimized include the number of decision trees and the number of characteristic attributes of the decision trees; use a test data set to test the prediction accuracy of the candidate random forest models; fit the functional relationship between the prediction accuracy of at least two candidate random forest models and the parameters to be optimized, and use it as the fitness function of the particle swarm algorithm; determine the value of the parameter to be optimized when the fitness function value is maximum as the optimized parameter to be optimized.
[0168] The off-network user prediction device provided in this embodiment can execute the off-network user prediction method provided in any one of the above embodiments 1 to 6. The specific implementation method and principle are similar and will not be repeated here.
[0169] Embodiment 8
[0170] Fig. 9 is a block diagram of an electronic device provided according to an eighth embodiment of the present application, such as Fig. 9 As shown, the electronic device 90 provided in this embodiment includes a memory 91 and a processor 92 .
[0171] The memory 91 and the processor 92 are interconnected in circuits.
[0172] The memory 91 stores computer-executable instructions.
[0173] The processor 92 executes the computer-executable instructions stored in the memory to implement the off-grid user prediction method provided by any one of the above embodiments.
[0174] Optionally, the electronic device 90 further includes a transceiver, which is used to send and receive data, for example, to receive the predicted off-network user data sent by the user terminal, send a user off-network data sample acquisition request to the database and receive the user off-network data sample sent by the database.
[0175] An embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the off-grid user prediction method provided in any one of the above embodiments.
[0176] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0177] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0178] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0179] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0180] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0181] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0182] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0183] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for predicting off-grid users, characterized in that: include: Acquire the data of users to be predicted to leave the network, and pre-process the data of users to be predicted to leave the network, so as to obtain the data set to be predicted; The data set to be predicted is input into a trained off-grid user prediction model, and the trained off-grid user prediction model is used to output potential off-grid users among the off-grid users to be predicted, wherein the trained off-grid user prediction model uses the training data set to train a random forest model, and when training the random forest model, a particle swarm algorithm is used to optimize the parameters of the random forest model; Before inputting the data set to be predicted into the trained off-network user prediction model, the method further includes: Acquire a user off-network data sample, wherein the user off-network data sample includes at least one user off-network indicator; Preprocessing the user off-network data samples to obtain a training data set and a test data set; The training data set is used to train the random forest model to obtain the trained random forest model, and the test data set is used to test the prediction accuracy of the trained random forest model; When the prediction accuracy is less than a preset prediction accuracy, fitting a functional relationship between the parameter to be optimized of the random forest model and the prediction accuracy, and using the functional relationship as a fitness function of the particle swarm algorithm; The value of the parameter to be optimized when the fitness function value is the maximum is determined as the optimized parameter to be optimized; The training data set is used to train the random forest model corresponding to the optimized parameters to be optimized, the trained random forest model is obtained again, and the test data set is used again to test the prediction accuracy of the trained random forest model; When the prediction accuracy is still less than the preset prediction accuracy, the functional relationship between the parameters to be optimized and the prediction accuracy of the two existing random forest models is fitted again, and the functional relationship is used as the fitness function of the particle swarm algorithm again, and the value of the parameter to be optimized when the fitness function value is the maximum is continued to be determined as the optimized parameter to be optimized; Repeat the above steps until the prediction accuracy of the random forest model corresponding to the optimized parameter to be optimized is greater than or equal to the preset prediction accuracy after being trained with the training data set and tested with the test data set, and the random forest model corresponding to the prediction accuracy greater than or equal to the prediction accuracy is determined as the trained off-grid user prediction model; The functional relationship is obtained by fitting in the following manner: determining the parameters to be optimized of the random forest model as independent variables, and determining the prediction accuracy of the random forest model as dependent variables; fitting the relationship between the prediction accuracy and the parameters to be optimized to obtain the functional relationship between the parameters to be optimized and the prediction accuracy of the random forest model; The preprocessing of the user off-network data sample includes: Obtain historical user off-network data samples; Determine whether there is a historical value of a missing-value off-network indicator in the historical user off-network data sample; the missing-value off-network indicator is a user off-network indicator with a missing value in the user off-network data sample; If it is determined that there is a historical value of the missing off-network indicator in the historical user off-network data sample, the historical value is used to fill the value of the missing off-network indicator; If it is determined that the historical value of the missing-value off-network indicator does not exist in the historical user off-network data sample, then deleting the sample to which the missing-value off-network indicator belongs from the user off-network data sample; And use the box graph analysis method to determine whether the value of each user's off-line index is within the preset value range of each user's off-line index [ U +1.5 IQR , L -1.5 IQR ]; among them, is the upper quartile of each user’s off-network indicator value, is the lower quartile of each user’s off-network indicator value, for The median of the values of each user's off-network indicator, is the difference between the upper quartile and the lower quartile of each user’s off-network indicator value; If the value of any user's off-network indicator is not within the preset value range of each indicator [ U +1.5 IQR , L -1.5 IQR ], it is identified as an abnormal value of the user off-line indicator, and the sample corresponding to the user off-line indicator with the abnormal value in the user off-line data sample is deleted; The user retention ratio is corrected according to 3G data traffic, 4G data traffic and 5G data traffic, where the 3G data traffic, 4G data traffic, 5G data traffic and user retention ratio are all user off-network indicators; wherein, the corrected user retention ratio = (4G data traffic + 5G data traffic) / (3G data traffic + 4G data traffic + 5G data traffic) × 100%.
2. The method according to claim 1, characterized in that The obtaining of user off-network data samples comprises: Using web crawler technology, crawling the value of each user off-line indicator of at least one user on the Internet; Each user off-network indicator of at least one user and a value of each user off-network indicator of the at least one user are determined as a user off-network data sample.
3. The method according to claim 1, characterized in that The method of obtaining a training data set and a test data set comprises: A first preset proportion of data in the user off-network data sample is determined as a training data set, and a second preset proportion of data in the user off-network data sample is determined as a test data set.
4. The method according to claim 1, characterized in that: The random forest model is trained using a training data set, and the prediction accuracy of the trained random forest model is tested using a test data set, including: Using the training data set to train at least two candidate random forest models, the candidate random forest models include parameters to be optimized, and the parameters to be optimized include the number of decision trees and the number of characteristic attributes of the decision trees; The test data set is used to test the prediction accuracy of the trained candidate random forest model.
5. An off-grid user prediction device, characterized in that: include: An acquisition module is used to acquire the to-be-predicted off-network user data and pre-process the to-be-predicted off-network user data to obtain a to-be-predicted data set; A prediction module, used for inputting a data set to be predicted into a trained off-grid user prediction model, and using the trained off-grid user prediction model to determine and output whether the user to be predicted is a potential off-grid user, wherein the trained off-grid user prediction model is obtained by training a random forest model using a training data set, and a particle swarm algorithm is used to optimize the parameters of the random forest model when training the random forest model; The device further comprises: a determination module; The determination module is used to obtain a user off-line data sample before inputting the data set to be predicted into the trained off-line user prediction model, wherein the user off-line data sample includes at least one user off-line indicator; pre-process the user off-line data sample to obtain a training data set and a test data set; train the random forest model using the training data set to obtain the trained random forest model, and use the test data set to test the prediction accuracy of the trained random forest model; when the prediction accuracy is less than the preset prediction accuracy, fit the functional relationship between the parameter to be optimized of the random forest model and the prediction accuracy, and use the functional relationship as the fitness function of the particle swarm algorithm; determine the value of the parameter to be optimized when the fitness function value is the maximum as the optimized parameter to be optimized; use the training data set to train the corresponding parameter to be optimized Random forest model, obtain the trained random forest model again, and use the test data set to test the prediction accuracy of the trained random forest model again; when the prediction accuracy is still less than the preset prediction accuracy, fit the functional relationship between the parameters to be optimized and the prediction accuracy of the two existing random forest models again, and use the functional relationship as the fitness function of the particle swarm algorithm again, and continue to determine the value of the parameter to be optimized when the fitness function value is maximum as the optimized parameter to be optimized; repeat the above steps until the random forest model corresponding to the optimized parameter to be optimized is trained with the training data set, and the prediction accuracy tested with the test data set is greater than or equal to the preset prediction accuracy, and the random forest model corresponding to the prediction accuracy greater than or equal to the prediction accuracy is determined as the trained off-grid user prediction model; The functional relationship is obtained by fitting in the following manner: determining the parameters to be optimized of the random forest model as independent variables, and determining the prediction accuracy of the random forest model as dependent variables; fitting the relationship between the prediction accuracy and the parameters to be optimized to obtain the functional relationship between the parameters to be optimized and the prediction accuracy of the random forest model; Wherein, when the user off-line data sample is preprocessed, the determination module is specifically used to obtain historical user off-line data samples; determine whether there is a historical value of a missing off-line indicator in the historical user off-line data sample; the missing off-line indicator is a user off-line indicator that is missing a value in the user off-line data sample; if it is determined that there is a historical value of the missing off-line indicator in the historical user off-line data sample, the historical value is used to fill the value of the missing off-line indicator; if it is determined that there is no historical value of the missing off-line indicator in the historical user off-line data sample, the sample to which the missing off-line indicator belongs is deleted from the user off-line data sample; And use the box graph analysis method to determine whether the value of each user's off-line index is within the preset value range of each user's off-line index [ U +1.5 IQR , L -1.5 IQR ]; among them, is the upper quartile of each user’s off-network indicator value, is the lower quartile of each user’s off-network indicator value, Q is The median of the values of each user's off-network indicator, is the difference between the upper quartile and the lower quartile of the value of each user's off-line indicator; if the value of any user's off-line indicator is not within the preset value range of each indicator [ U +1.5 IQR , L -1.5 IQR ], it is identified as an abnormal value of the user off-line indicator, and the sample corresponding to the user off-line indicator with the abnormal value in the user off-line data sample is deleted; The user retention ratio is corrected according to 3G data traffic, 4G data traffic and 5G data traffic, where the 3G data traffic, 4G data traffic, 5G data traffic and user retention ratio are all user off-network indicators; wherein, the corrected user retention ratio = (4G data traffic + 5G data traffic) / (3G data traffic + 4G data traffic + 5G data traffic) × 100%.
6. An electronic device, characterized in that: include: Memory and processor; The memory and the processor circuit are interconnected; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 4 when executed by a processor.
8. A computer program product comprising: A computer program, characterized in that when the computer program is executed by a processor, it is used to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Industrial production process fault diagnosis method based on data driving
CN109657945A
Off-network prediction method and device, server and storage medium
CN110971460A