User number prediction method and device and medium
By combining the comprehensive regression prediction model and the time series prediction model, the number of users in various caliber classifications is solved, and the accuracy and stable prediction of the number of users is achieved, and the strong Strong market decision-making support.
Patent Information
- Application Number
- CN202411225539.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-22
AI Technical Summary
In the existing user number prediction technology, the accuracy of a single prediction model is not high, making it difficult to accurately predict the development of the number of users.
A method combining a comprehensive regression prediction model and a time series prediction model is adopted to obtain the number of users in multiple caliber classifications, make predictions separately, and linearly fuse the two prediction results to improve the accuracy of user count prediction.
It realizes the accuracy and stability of the number of users prediction results, can update the monthly indicator prediction values every day, solves the problem of low prediction accuracy of a single model, and provides stronger market decision support.
Smart Images

Figure CN119006038A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure at least relates to the field of data analysis technology, and in particular to a user number prediction method, a user number prediction device, and a computer-readable storage medium. Background Art
[0002] Market forecasting is an indispensable part of business management, which can help enterprises make correct business decisions, improve competitiveness, improve business management, reduce operating costs and conduct market positioning. For example, in the field of mobile communications, more accurate prediction of the development of the number of users can provide strong data support for operators' business development and product formulation, which is conducive to scientific decision-making.
[0003] The current technology for user prediction generally uses regression algorithms to build models for prediction based on the results of feature selection, but there is a difficulty that the prediction accuracy of a single prediction model is not high. Summary of the invention
[0004] The technical problem to be solved by the present disclosure is to provide a user number prediction method, a user number prediction device and a computer-readable storage medium in view of the above-mentioned shortcomings, so as to solve the problem of how to improve the accuracy of user number prediction.
[0005] In a first aspect, the present disclosure provides a method for predicting the number of users, the method comprising:
[0006] Continuously obtain the number of first users of level k distributed by caliber j in period i = (1, 2, ..., p) and i = (1,2,…,p) periods of the second user number distributed by date
[0007] The number of first users according to the distribution of level k of caliber j in period i = (1, 2, ..., p) Use comprehensive regression forecasting model to forecast period t=(p+1,p+2,…,n)
[0008] The third user number
[0009] The number of second users distributed by date according to period i = (1, 2, ..., p) Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n)
[0010] According to the number of third users and the fourth number of users Get the user number prediction result.
[0011] Further, the number of first users distributed by level k of caliber j in period i = (1, 2, ..., p) is continuously obtained and i = (1,2,…,p) periods of the second user number distributed by date Specifically include:
[0012] Set multiple classification levels k for at least one user caliber j among network signal quality, tariff level, activity, and service type,
[0013] Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range
[0014] Get the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range,
[0015] Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p)
[0016] Further, wherein:
[0017] The prediction expression of the comprehensive regression prediction model is:
[0018]
[0019] The prediction expression of the time series prediction model is:
[0020]
[0021] in, ε t (θ 1 ), ε t (θ 2 ) are the parameters obtained by pre-training the comprehensive regression prediction model and the time series prediction model,
[0022] Further, wherein:
[0023] The parameters of the comprehensive regression prediction model and the time series prediction model are obtained in advance based on historical data training, and the historical data includes multiple groups of i = (1, 2, ..., p) periods and the number of historical first users distributed by level k according to caliber j. i=(1,2,…,p) period historical second user number distributed by date and t = (p+1, p+2, ..., n) historical real user numbers
[0024] Further, wherein:
[0025] During the training process, after the initial parameters of the comprehensive regression prediction model and / or the time series prediction model are given, the parameters of the comprehensive regression prediction model and / or the time series prediction model are adjusted according to the following objective function expression:
[0026]
[0027] in:
[0028] φ γ (ε t (θ)) is the exponential square loss function:
[0029] φ γ (ε t (θ))=1-exp(-(ε t (θ) 2 / γ)
[0030] is the penalty function:
[0031]
[0032] in, is a set of real numbers, γ>0 is the loss estimation adjustment parameter, λ i >0 is the penalty intensity adjustment parameter, θ=θ 1 or θ 2 ,θ i is the current coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, is the previous coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, or
[0033] Further, according to the third user number and the fourth number of users Get the user number prediction results, including:
[0034] Calculate the fifth number of users in period t = (p+1, p+2, ..., n) in is the weight and satisfies and / or,
[0035] Calculate the number of third users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y 1 , calculate the fourth number of users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y 2, calculate the third predicted total number of users y = w 1 y 1 +w 2 y 2 , where w 1 ,w 2 is the weight, and satisfies 0≤w 1 ,w 2 ≤1,w 1 +w 2 =1.
[0036] In a second aspect, the present disclosure provides a user number prediction device, the device comprising:
[0037] Basic data module, used to continuously obtain the number of first users distributed by level k in period i = (1, 2, ..., p) according to caliber j and i = (1,2,…,p) periods of the second user number distributed by date
[0038] The first prediction module is connected to the basic data module and is used to predict the number of first users distributed according to level k of caliber j in period i = (1, 2, ..., p) Use comprehensive regression prediction model to predict the number of third users in period t=(p+1,p+2,…,n)
[0039] The second prediction module is connected to the basic data module and is used to calculate the second user number distributed by date according to period i=(1,2,…,p). Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n)
[0040] A result fusion module is connected to the first prediction module and the second prediction module, and is used to generate a result according to the third user number. and the fourth number of users Get the user number prediction result.
[0041] Furthermore, the basic data module specifically includes:
[0042] The first basic data unit is used to set multiple classification levels k of at least one user caliber j among network signal quality, tariff level, activity, and service type.
[0043] Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range
[0044] The second basic data unit is used to obtain the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range.
[0045] Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p)
[0046] Further, wherein:
[0047] The prediction expression of the comprehensive regression prediction model in the first prediction module is:
[0048]
[0049] The prediction expression of the time series prediction model in the second prediction module is:
[0050]
[0051] The device also includes a model training module for pre-training to obtain parameters of the comprehensive regression prediction model and the time series prediction model. ε t (θ 1 ), ε t (θ 2 ),
[0052] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the user number prediction method as described above is implemented.
[0053] The present disclosure provides a user number prediction method, a user number prediction device and a computer-readable storage medium, which improve the accuracy of the user number prediction result by combining two prediction methods. Specifically, by obtaining a first user number classified by multiple calibers, a first user number prediction result is obtained according to the first user number prediction, and a second user number is obtained according to the date for prediction to obtain a second user number prediction result. Finally, the two prediction results are combined to obtain a final prediction result of the user number, thereby improving the accuracy of the user number prediction result. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a flow chart of a method for predicting the number of users according to an embodiment of the present disclosure;
[0055] Figure 2 is a flow chart of another method for predicting the number of users according to an embodiment of the present disclosure;
[0056] Figure 3It is a structural diagram of a user number prediction device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0058] It should be understood that the specific embodiments and drawings described herein are only used to explain the present disclosure rather than to limit the present disclosure.
[0059] It can be understood that, in the absence of conflict, the various embodiments of the present disclosure and the various features in the embodiments can be combined with each other.
[0060] It can be understood that, for the convenience of description, the drawings of the present disclosure only show parts related to the present disclosure, while parts irrelevant to the present disclosure are not shown in the drawings.
[0061] It can be understood that each unit and module involved in the embodiments of the present disclosure may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0062] It will be understood that, in the absence of conflict, the functions and steps marked in the flowcharts and block diagrams of the present disclosure may occur in an order different from that marked in the drawings.
[0063] It is understood that the flowcharts and block diagrams of the present disclosure illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present disclosure. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0064] It can be understood that the units and modules involved in the embodiments of the present disclosure can be implemented by software or hardware, for example, the units and modules can be located in a processor.
[0065] Embodiment 1:
[0066] like Figure 1 As shown, the present disclosure provides a method for predicting the number of users, the method comprising:
[0067] S1. Continuously obtain the number of first users distributed by level k in period i = (1, 2, ..., p) according to caliber j and i = (1,2,…,p) periods of the second user number distributed by date
[0068] S2, the number of first users distributed by level k according to caliber j in period i = (1, 2, ..., p) Use comprehensive regression prediction model to predict the number of third users in period t=(p+1,p+2,…,n)
[0069] S3, the number of second users distributed by date according to period i = (1, 2, ..., p) Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n)
[0070] S4. According to the number of third users and the fourth number of users Get the user number prediction result.
[0071] In this embodiment, the method improves the accuracy of the user number prediction results by combining two prediction methods. Specifically, by obtaining the first user number classified by multiple calibers, obtaining a first user number prediction result based on the first user number prediction, obtaining the second user number according to the date for prediction, so as to obtain a second user number prediction result, and finally combining the two prediction results to obtain the final prediction result of the user number, thereby improving the accuracy of the user number prediction results.
[0072] More specifically, this embodiment takes the prediction of the number of newly developed users per month as an example, and the sample data is the number of newly developed users per day in the historical account period. If the current technology is used, the prediction step can generally be implemented as follows: extract a feature data set from the sample data, perform feature selection to obtain effective user features, establish a daily model based on a regression algorithm, and output the predicted value of the predicted day (generally t-1 account period) every day, but it is not possible to output the predicted value of the current month every day; you can also use the time series prediction technology, first accumulate the daily cycle data and convert it into monthly cycle data, and then establish a time series model based on the monthly cycle data for prediction, and output the prediction result of the current month every month, but it is not possible to update the predicted value of the current month every day. The user number prediction method provided in this embodiment is used to solve the problem that the constructed daily model cannot realize the prediction of the current month and the monthly model cannot realize daily update. In addition, it can also solve the difficulty of low prediction accuracy of a single prediction model.
[0073] On the one hand, in order to use the daily regression model to achieve monthly index prediction, this example uses feature selection to select effective features in the daily index sample data set, and uses the number of monthly users as the dependent variable value corresponding to the daily feature vector of the month to build a regression-type daily model, which can output the monthly prediction value every day; on the other hand, the daily index sample data is accumulated as the monthly index data, and the trend and development law of the number of users in the historical account period over time are analyzed to establish a time series monthly model to obtain the prediction value of the number of users in the current month; finally, the monthly prediction values of the two models are linearly combined to obtain the fused prediction result. When establishing the regression model, different from the general linear or nonlinear regression model, a new type of penalty regression model is constructed, in which the loss function uses the exponential square loss and the penalty function uses the adaptive LASSO (Least absolute shrinkage and selection operator, minimum absolute shrinkage and selection algorithm), which improves the robustness of the model and the accuracy of the prediction, makes up for the shortcomings of the existing technology, and not only realizes the daily update of the monthly prediction value by building a fusion model, but also makes the prediction more stable and accurate.
[0074] In one embodiment, S1, continuously obtain the first number of users distributed according to level k of caliber j for period i=(1,2,…,i) and i = (1,2,…,p) periods of the second user number distributed by date Specifically include:
[0075] Set multiple classification levels k for at least one user caliber j among network signal quality, tariff level, activity, and service type,
[0076] Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range
[0077] Get the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range,
[0078] Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p)
[0079] In this embodiment, according to the mobile communication field involved, various user number classification collection standards are designed. For example, for users served by a base station, the number of users connected to the base station every day in the past month is collected, and the number of daily users with excellent, medium and poor network signal quality, high, medium and low tariff levels, high, medium and low activity, and business type is commercial users or home users is counted. Date distribution considers date characteristics, including whether the day is a weekday, weekend or holiday, the characteristics of the month, etc.
[0080] More specifically, if Figure 2 As shown, a new type of combined prediction method for monthly indicators related to the number of users is disclosed, which includes: collecting and integrating underlying user-level data, such as collecting daily basic data of historical account periods of indicators (such as collecting nearly one year); data cleaning and data preprocessing; performing feature selection and feature derivation on the sample set to obtain the target feature set; building a regression prediction model based on exponential square loss and adaptive LASSO penalty, including model training to achieve daily output of monthly indicator prediction values; building a time series prediction model, which is a trained time series AR (Autoregressive Model, autoregressive model) model, and outputting monthly indicator prediction values every day; linearly fusing the prediction results of the two models, and outputting the final prediction results of the number of monthly users every day. In order to stabilize the output results of the time series prediction model, a time series data stationarity test can also be included, and non-stationary time series must be stabilized. Through the above steps, the changes in the number of users in the coming months can be accurately predicted. The penalized regression model ensures the robustness of the daily model, and the combined model ensures the accuracy of the prediction results, making the prediction more accurate and the performance more stable. It can be reused in user number prediction in various business scenarios, and also provides an accurate basis for the business strategies of operators and a strong support for market business development.
[0081] In one embodiment, wherein:
[0082] The prediction expression of the comprehensive regression prediction model is:
[0083]
[0084] The prediction expression of the time series prediction model is:
[0085]
[0086] in, ε t (θ 1 ), ε t (θ 2 ) are the parameters obtained by pre-training the comprehensive regression prediction model and the time series prediction model,
[0087] In this embodiment, the time series prediction model is essentially also a regression model. The two models mainly analyze data from different angles, but the model principles are similar.
[0088] In one embodiment, wherein:
[0089] The parameters of the comprehensive regression prediction model and the time series prediction model are obtained in advance based on historical data training, and the historical data includes multiple groups of i = (1, 2, ..., p) periods and the number of historical first users distributed by level k according to caliber j. i=(1,2,…,p) period historical second user number distributed by date and t = (p+1, p+2, ..., n) historical real user numbers
[0090] In this embodiment, the training principle of the model is universal. By collecting historical data that can achieve the design goals, training set and validation set data are generally designed. The model parameters are continuously adjusted by inputting the training set data into the model so that the model can output prediction data close to the real data. The validation set is used to verify the final training effect of the model, and a model that meets the requirements is obtained, which can be used for subsequent predictions.
[0091] In one embodiment, wherein:
[0092] During the training process, after the initial parameters of the comprehensive regression prediction model and / or the time series prediction model are given, the parameters of the comprehensive regression prediction model and / or the time series prediction model are adjusted according to the following objective function expression:
[0093]
[0094] in:
[0095] φ γ (ε t (θ)) is the exponential square loss function:
[0096] φ γ (ε t (θ))=1-exp(-(ε t (θ) 2 / γ)
[0097] is the penalty function:
[0098]
[0099] in, is a set of real numbers, γ>0 is the loss estimation adjustment parameter, λ i>0 is the penalty intensity adjustment parameter, θ=θ 1 or θ 2 ,θ i is the current coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, is the previous coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, or
[0100] In this embodiment, model training is an iterative process, which continuously optimizes the parameters of the independent variables through iteration, that is, optimizes the parameters corresponding to the first number of users and the second number of users after they are input into the model. The prediction model can be constructed differently from the commonly used LASSO regression and ridge regression methods. A new penalty regression method based on exponential square loss and adaptive LASSO penalty is used to construct a regression prediction model. The prediction model expression is described as:
[0101]
[0102] Among them, the exponential square loss function φ γ (t) = 1-exp(-t 2 / γ), which reduces the sensitivity to extreme errors and can provide more robust results. The adaptive Lasso penalty function is It introduces adaptive weights, which can more effectively identify and select important variables and improve the prediction accuracy of the model. Another important point is that it has the Oracle property, that is, under certain conditions, it can consistently select the correct variables, and its estimated parameters are close to the optimal; when fitting the regression prediction model, generally, the daily eigenvalue corresponds to the daily response variable, that is, based on the daily eigenvalue, only the prediction of the number of users on that day can be achieved. In this embodiment, the number of users in the current month is used as the response variable, so that the prediction result of the number of users in the current month can be output every day.
[0103] In one embodiment, S4, according to the third user number and the fourth number of users Get the user number prediction results, including:
[0104] Calculate the fifth number of users in period t = (p+1, p+2, ..., n) in is the weight and satisfies and / or,
[0105] Calculate the number of third users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y 1 , calculate the fourth number of users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y 2 , calculate the third predicted total number of users y = w 1 y 1 +w 2 y 2 , where w 1 ,w 2 is the weight, and satisfies 0≤w 1 ,w 2 ≤1,w 1 +w 2 =1.
[0106] In this embodiment, the regression model is first fitted to realize the daily update of the predicted value of the monthly number of users indicator, and then the time series model is fitted to realize the monthly update and output of the predicted value of the indicator, and then the two models are integrated and output using the linear fusion method to obtain the final prediction result. Of course, it is not ruled out that the prediction result of daily user data can be obtained according to the method of this embodiment. The predicted value of the regression model is further corrected using the predicted value of the time series model, which not only realizes the daily update of the monthly indicator prediction result, but also further improves the accuracy of the prediction.
[0107] More specifically, a complete and detailed example process of this embodiment is as follows:
[0108] 1) Collect basic indicator data from multiple data sources, including but not limited to the daily user number indicators and the historical data of related indicators in recent one year in different databases or application platforms, integrate data from different sources, and construct a sample data set;
[0109] 2) Data preprocessing is an important step before data analysis and modeling, including data integration, data cleaning, data transformation and other processes to ensure data quality and accuracy;
[0110] 3) Common data integration methods include data merging, data connection and data aggregation. Data merging is to merge multiple data sets according to a common attribute. Data connection is to connect multiple data sets based on a common attribute. Data aggregation is to perform aggregation calculations such as averaging, summing, and counting on the data in multiple data sets. By using data merging, data from different sources can be integrated according to the account period.
[0111] 4) Perform data cleaning on the sample data set, including preliminary screening of the data according to the required account period, region and other conditions, removing duplicate values by deduplication of the data set, processing missing values by deletion and interpolation methods, identifying and cleaning outliers by statistical analysis techniques, processing inconsistent data by data conversion and unified format, and obtaining the full set of features related to the number of users after cleaning;
[0112] 5) The characteristics include but are not limited to date-related characteristics (such as month, day, day of the week) and the number of users in various categories classified by various criteria (such as classification by development channel, classification by user activity, classification by tariff level, etc.);
[0113] 6) Perform data standardization, data transformation and data normalization processing, standardize the cleaned data, convert it into dimensionless values to facilitate weighted calculations between indicators, scale the data according to a certain ratio to facilitate model calculation and convergence, perform function transformation on the data to facilitate the discovery of hidden laws in the data, and convert the data according to certain specifications to facilitate comparison and analysis between different data;
[0114] 7) Use the filtering method to select features from the preprocessed feature set data to eliminate irrelevant or redundant features, reduce the dimension and simplify the model, reduce the time of analysis and training the model, and improve the generalization ability of the model. The focus is mainly on the correlation between a single feature and the target variable. The strength of the correlation is calculated by the Pearson correlation coefficient method. Each dimension of the feature is given a weight according to the size of the correlation coefficient. The importance of the features is sorted based on the weights, and the features with high importance are retained to obtain the data set after feature selection;
[0115] 8) Feature derivation: generating new features by converting, calculating and combining the original features, including basic conversion of a single feature, such as log conversion of a feature value (for features with a large value range, log conversion can compress its value range, making the data more stable; the distribution of some features may be seriously skewed, and log conversion can make the data distribution closer to the normal distribution; log conversion can reduce the impact of outliers on the model, making model training more robust; log conversion can directly interpret the model coefficients as percentage changes, improving the interpretability of the model), marking whether the day is a holiday (adding a field to reflect whether the day is a holiday, because the number of operator products and users will be affected by holidays, for example, the number of new users developed during holidays will be more than that on weekdays); adding a time dimension to a single feature, such as calculating the cumulative value of a feature in the previous N days and the average value of the past N months; multi-feature combination operations, such as adding or comparing two feature values, to obtain the target feature set after adding the derived feature;
[0116] 9) Use the holdout method to directly divide the target feature set into two mutually exclusive sets, one of which is used as a training set and the other as a test set. For example, for a data set containing 1,000 samples, a 7 / 3 split can be used to divide it into a training set containing 700 samples and a test set containing 300 samples.
[0117] 10) Construct a penalty regression prediction model based on exponential square loss. The objective function expression can be described as:
[0118]
[0119] where φ γ (·) is the exponential square loss function, is the penalty function;
[0120] 11) The loss function is a non-negative real-valued function that describes the degree of inconsistency between the model's predicted value and the true value. Generally speaking, the better the loss function, the better the performance of the model. Considering that the exponential square loss function has strong robustness, the exponential square loss is used to build the model. The function expression is:
[0121] φ γ (t) = 1-exp(-t 2 / γ)
[0122] Adjusting the parameter γ>0 can control the efficiency and robustness of the estimation to a certain extent. Furthermore, the loss function used can be described as:
[0123] φ γ (ε t (θ))=1-exp(-(ε t (θ) 2 / γ)
[0124] 12) Regularization is a technique used to control model complexity. Adding a penalty function regularization term to the loss function can force the model to remain simple while fitting the training data to avoid overfitting. Adaptive Lasso is an improvement on the traditional Lasso method. By applying adaptive weights to different coefficients to optimize the penalty process, it can more effectively identify and select important variables and improve the prediction accuracy of the model. The function expression is:
[0125]
[0126] Among them, λ i >0 is the adjustment parameter, which controls the intensity of the penalty, θ i is the coefficient of the ith independent variable, θ i (i=1,2,...,p),θ=(θ 1 ,θ 2 ,...,θ p ) T , in represents a set of real numbers, and the penalty function used can be described as:
[0127]
[0128] 13) Process the historical account period daily user number indicators in the training set, and accumulate the original data of daily user numbers in each month to obtain the monthly user number;
[0129] 14) Generally, the daily independent variable corresponds to the daily response variable index value. In particular, the response variable corresponding to the daily characteristic value is set to the number of users in the month, and the above regression prediction model is fitted to achieve the daily output of the regression model prediction result, which is the number of users in the month;
[0130] 15) The AR timing model expression can be described as:
[0131]
[0132] where {y t ,t=1,2,…,n 0} is a time series, {ε t} is a sequence of independent and identically distributed random variables with mean zero and variance constant σ 2 ,θ i (i=1,2,...,p) reflects the current moment y t For the past time y t-i The size of the dependence, p is the order of the time series, θ p ≠0, so we get (t=p+1,...,n 0 );like:
[0133] When t=p+1, substituting into the formula, ε p+1 (θ) = y p+1 -(θ 1 y p+1-1 +θ 2 y p+1-2 +...+θ p y p+1-p ), the last item is y 1 , that is, the time series {y t ,t=1,2,…,n 0}, the sequence starts from p+1.
[0134] 16) Before fitting a time series prediction model, the sequence must be tested for stationarity. There are two commonly used testing methods. One is to draw a time series graph and an autocorrelation graph to analyze the data characteristics and make judgments. The other is to construct a test statistic for hypothesis testing. If the first method is used, call matplotlib and statsmodels packages in Python to draw relevant graphs for judgment;
[0135] 17) If the time series is found to be a non-stationary series, it must be stabilized first, such as by calling the pandas library to perform differential processing on the data to achieve sequence stabilization. Generally, for sample sequences containing significant linear trends, first-order differences are performed to achieve trend stabilization. For sample sequences containing curve trends, second-order or third-order differences are used to eliminate the influence of the curve trend. For non-stationary sequences containing both trends and cycles, general difference operations and seasonal difference operations need to be used simultaneously.
[0136] 18) Based on the monthly user number sequence after stabilization, fit the above time series prediction model, and output the time series model prediction result of the number of users in the current month according to the historical data of the number of users in the previous month and previous months;
[0137] 19) The prediction accuracy of a single model is not high and it is easy to overfit. The fusion of multiple models can often improve the prediction ability and generalization ability of the model. There are many ways to create and combine multiple models. According to the implementation method of the integrated model, the integrated methods can generally be divided into five categories: voting, averaging, stacking, bagging, and boosting;
[0138] 20) Based on the idea of mean integration method, the linear fusion method is used to integrate the prediction results of the two models. First, a weight w is determined for the prediction result of each model. 1 ,w 2 , and satisfy 0≤w 1 ,w 2 ≤1,w 1 +w 2 =1, assuming that the prediction value of model 1 is The predicted value of model 2 is Then the predicted value after linear fusion is:
[0139]
[0140] The purpose of correcting the predicted value of the regression model with the predicted value of the time series model is achieved;
[0141] 21) Define the parameter grid and perform grid search by calling the GridSearchCV class in the sklearn library. This class will automatically traverse all combinations in the parameter grid and cross-validate each combination to obtain the optimal parameter combination for the fusion model, ultimately achieving daily updates of the user number forecast results for this month.
[0142] The method of this embodiment can be used in production and operation projects, and can provide substantial help in the prediction of indicators such as the number of new mobile service users and the number of broadband access billing users.
[0143] Embodiment 2:
[0144] like Figure 3 As shown, the present disclosure provides a user number prediction device, the device comprising:
[0145] Basic data module 1, used to continuously obtain the first user number of level k distribution according to caliber j in period i = (1, 2, ..., p) and i = (1,2,…,p) periods of the second user number distributed by date
[0146] The first prediction module 2 is connected to the basic data module 1 and is used to predict the number of first users distributed according to the level k of the caliber j in period i = (1, 2, ..., p) Use comprehensive regression prediction model to predict the number of third users in period t=(p+1,p+2,…,n)
[0147] The second prediction module 3 is connected to the basic data module 1 and is used to calculate the second user number distributed by date according to period i = (1, 2, ..., p). Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n)
[0148] The result fusion module 4 is connected to the first prediction module 2 and the second prediction module 3, and is used to generate a result according to the third user number. and the fourth number of users Get the user number prediction result.
[0149] In one embodiment, the basic data module 1 specifically includes:
[0150] The first basic data unit is used to set multiple classification levels k of at least one user caliber j among network signal quality, tariff level, activity, and service type.
[0151] Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range
[0152] The second basic data unit is used to obtain the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range.
[0153] Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p)
[0154] In one embodiment, wherein:
[0155] The prediction expression of the comprehensive regression prediction model in the first prediction module 2 is:
[0156]
[0157] The prediction expression of the time series prediction model in the second prediction module 3 is:
[0158]
[0159] The device also includes a model training module for pre-training to obtain parameters of the comprehensive regression prediction model and the time series prediction model. ε t (θ 1 ), ε t (θ 2 ),
[0160]
[0161] In one embodiment, in the model training module:
[0162] The parameters of the comprehensive regression prediction model and the time series prediction model are obtained in advance based on historical data training, and the historical data includes multiple groups of i = (1, 2, ..., p) periods and the number of historical first users distributed by level k according to caliber j. i=(1,2,…,p) period historical second user number distributed by date and t = (p+1, p+2, ..., n) historical real user numbers
[0163] In one embodiment, the model training module is specifically used to:
[0164] During the training process, after the initial parameters of the comprehensive regression prediction model and / or the time series prediction model are given, the parameters of the comprehensive regression prediction model and / or the time series prediction model are adjusted according to the following objective function expression:
[0165]
[0166] in:
[0167] φ γ (ε t (θ)) is the exponential square loss function:
[0168] φ γ (ε t (θ))=1-exp(-(ε t (θ) 2 / γ)
[0169] is the penalty function:
[0170]
[0171] in, is a set of real numbers, γ>0 is the loss estimation adjustment parameter, λ i >0 is the penalty intensity adjustment parameter, θ=θ 1 or θ 2 ,θ i is the current coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, is the previous coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, or
[0172] In one implementation, the result fusion module 4 specifically includes:
[0173] The first fusion unit is used to calculate the fifth user number in period t = (p+1, p+2, ..., n) in is the weight and satisfies and / or,
[0174] The second fusion unit is used to calculate the number of third users in period t = (p+1, p+2, ..., n) The sum of the first predicted total number of users y 1 , calculate the fourth number of users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y 2 , calculate the third predicted total number of users y = w 1 y 1 +w 2 y 2 , where w 1 ,w 2 is the weight, and satisfies 0≤w 1 ,w 2 ≤1,w 1 +w 2 =1.
[0175] Embodiment 3:
[0176] Embodiment 3 of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method for predicting the number of users as described in Embodiment 1 or the device for predicting the number of users as described in Embodiment 2 is implemented.
[0177] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0178] In addition, the present disclosure may also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes the user number prediction method as described in Example 1. The computer device may be the user number prediction device as described in Example 2.
[0179] The memory is connected to the processor, the memory may be a flash memory or a read-only memory or other memory, and the processor may be a central processing unit or a single-chip microcomputer.
[0180] Embodiments 1-3 of the present disclosure provide a method for predicting the number of users, a device for predicting the number of users, and a computer-readable storage medium, which improve the accuracy of the prediction results of the number of users by combining two prediction methods. Specifically, a first number of users classified according to multiple calibers is obtained, a first user number prediction result is obtained based on the prediction of the first user number, a second user number is obtained according to the date for prediction to obtain a second user number prediction result, and finally the two prediction results are combined to obtain a final prediction result of the number of users, thereby improving the accuracy of the user number prediction result.
[0181] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A method for predicting the number of users, characterized in that: The method comprises: Continuously obtain the number of first users of level k distributed by caliber j in period i = (1, 2, ..., p) and i = (1,2,…,p) periods of the second user number distributed by date The number of first users according to the distribution of level k of caliber j in period i = (1, 2, ..., p) Use comprehensive regression prediction model to predict the number of third users in period t=(p+1,p+2,…,n) The number of second users distributed by date according to period i = (1, 2, ..., p) Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n) According to the number of third users and the fourth number of users Get the user number prediction result.
2. The method according to claim 1, characterized in that Continuously obtain the number of first users of level k distributed by caliber j in period i = (1, 2, ..., p) and i = (1,2,…,p) periods of the second user number distributed by date Specifically include: Set multiple classification levels k for at least one user caliber j among network signal quality, tariff level, activity, and service type, Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range Get the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range, Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p) 3. The method according to claim 1 or 2, characterized in that: in: The prediction expression of the comprehensive regression prediction model is: The prediction expression of the time series prediction model is: in, ε t (θ 1 ), ε t (θ 2 ) are the parameters obtained by pre-training the comprehensive regression prediction model and the time series prediction model, 4. The method according to claim 3, characterized in that in: The parameters of the comprehensive regression prediction model and the time series prediction model are obtained in advance based on historical data training, and the historical data includes multiple groups of i = (1, 2, ..., p) periods and the number of historical first users distributed by level k according to caliber j. The number of historical second users by date and t = (p+1, p+2, ..., n) historical real user numbers 5. The method according to claim 4, characterized in that in: During the training process, after the initial parameters of the comprehensive regression prediction model and / or the time series prediction model are given, the parameters of the comprehensive regression prediction model and / or the time series prediction model are adjusted according to the following objective function expression: in: φ γ (ε t (θ)) is the exponential square loss function: f γ (e t (θ))=1-exp(-(ε t (i)) 2 / c) is the penalty function: in, is a set of real numbers, γ>0 is the loss estimation adjustment parameter, λ i >0 is the penalty intensity adjustment parameter, θ=θ 1 or θ 2 ,θ i is the current coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, is the previous coefficient of the ith independent variable in the comprehensive regression forecasting model or time series forecasting model, or 6. The method according to claim 4, characterized in that According to the number of third users and the fourth number of users Get the user number prediction results, including: Calculate the fifth number of users in period t = (p+1, p+2, ..., n) in is the weight and satisfies and / or, Calculate the number of third users in period t=(p+1,p+2,…,n) The sum of the first predicted total number of users y1 is calculated, and the fourth number of users in period t = (p+1, p+2, ..., n) is calculated. The sum is used to obtain the first predicted total number of users y2, and the third predicted total number of users y=w1y1+w2y2 is calculated, where w1, w2 are weights and satisfy 0≤w1,w2≤1,w1+w2=1.
7. A user number prediction device, characterized in that: The device comprises: Basic data module, used to continuously obtain the number of first users distributed by level k in period i = (1, 2, ..., p) according to caliber j and i = (1,2,…,p) periods of the second user number distributed by date The first prediction module is connected to the basic data module and is used to predict the number of first users distributed according to level k of caliber j in period i = (1, 2, ..., p) Use comprehensive regression prediction model to predict the number of third users in period t=(p+1,p+2,…,n) The second prediction module is connected to the basic data module and is used to calculate the second user number distributed by date according to period i=(1,2,…,p). Use the time series prediction model to predict the number of fourth users in period t=(p+1,p+2,…,n) A result fusion module is connected to the first prediction module and the second prediction module, and is used to generate a result according to the third user number. and the fourth number of users Get the user number prediction result.
8. The device according to claim 7, characterized in that The basic data module specifically includes: The first basic data unit is used to set multiple classification levels k of at least one user caliber j among network signal quality, tariff level, activity, and service type. Get the number of first users per day distributed at each classification level k for each user caliber j in the i = (1, 2, ..., p) consecutive periods before today within the predicted network service range The second basic data unit is used to obtain the total number of users per day for i=(1,2,…,p) consecutive periods before today within the predicted network service range. Mark the corresponding daily date features for all daily users to obtain the daily second user number distributed by date features in period i = (1, 2, ..., p) 9. The device according to claim 7 or 8, characterized in that in: The prediction expression of the comprehensive regression prediction model in the first prediction module is: The prediction expression of the time series prediction model in the second prediction module is: The device also includes a model training module for pre-training to obtain parameters of the comprehensive regression prediction model and the time series prediction model. ε t (θ 1 ), ε t (θ 2 ), 10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for predicting the number of users according to any one of claims 1 to 6 or the device for predicting the number of users according to any one of claims 7 to 9 is implemented.
