Method for establishing prediction model, prediction method, device, medium and equipment
By dynamically segmented processing of user age sample data and weighted processing of behavioral characteristic values, a user age prediction model was established, which solved the problem of low user age prediction accuracy in the prior art, and significantly improved the prediction accuracy.
Patent Information
- Application Number
- CN201811526578.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-13
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2038-12-13
AI Technical Summary
In the prior art, the prediction accuracy of the user age prediction method is low, and it is difficult to effectively obtain user characteristic data.
The age sample data of massive historical users is processed in a dynamic segmentation method, and N age groups are obtained as sample labels. By obtaining and processing the user's behavioral data and behavior data weights on multiple categories, the user's behavior characteristic values are calculated, and finally the machine learning model is trained to establish a user's age prediction model.
Through dynamic segmentation and behavioral data weighting, the prediction accuracy of the user's age prediction model is improved, and the problem of low prediction accuracy caused by the fixed method of age division is overcome.
Smart Images

Figure CN111325372B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data processing technology, and in particular to a method for establishing a user age prediction model, a method for predicting user age, a device for establishing a user age prediction model, a device for predicting user age, a computer-readable medium and an electronic device. Background Art
[0002] In the e-commerce field, merchants provide users with personalized services based on their gender, age, preferences and other characteristic data to improve their experience. However, as users' privacy awareness increases, it becomes increasingly difficult for merchants to obtain users' characteristic data in order to avoid privacy data leakage and other issues.
[0003] In the prior art, in order to obtain the characteristic data of the user, a model is built based on the behavior data of the historical users, and then the age of the current user is predicted through a mathematical model.
[0004] However, the prediction accuracy of the prediction method provided by the prior art needs to be improved.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] The purpose of the embodiments of the present invention is to provide a method for establishing a user age prediction model, a method for predicting user age, a device for establishing a user age prediction model, a device for predicting user age, a computer-readable medium and an electronic device, thereby at least to a certain extent overcoming the problem of low prediction accuracy of the prediction methods provided by the prior art.
[0007] Other features and advantages of the present invention will become apparent from the following detailed description, or may be learned in part by practice of the present invention.
[0008] According to a first aspect of an embodiment of the present invention, a method for establishing a user age prediction model is provided, comprising:
[0009] The obtained massive historical user age sample data is processed by dynamic segmentation to obtain N age groups as sample labels, where N is a positive integer.
[0010] Obtaining behavior data of historical users of the N age groups in multiple categories and weights corresponding to the behavior data in the multiple categories, and processing the behavior data and the weights to obtain behavior feature values corresponding to the historical users of the N age groups;
[0011] A machine learning model is trained according to the sample labels and the behavior feature values to obtain a user age prediction model.
[0012] In some embodiments of the present invention, based on the above solution, a dynamic segmentation method is used to process the acquired age sample data of massive historical users to obtain N age groups as sample labels, including:
[0013] Counting the age sample data of the massive historical users to obtain an upper age limit and a lower age limit;
[0014] Determine a preliminary age range value for each age group according to the preset number N of age groups and the upper age limit and the lower age limit;
[0015] Segmenting the preliminary age range values in a dynamic programming manner to determine a plurality of intermediate age range values;
[0016] The Gini impurities of the multiple middle age range values are calculated, and the middle age range value with the smallest Gini impurity is used as the final age range value to complete the determination of the sample label.
[0017] In some embodiments of the present invention, based on the above scheme, the behavior data of the historical users of the N age groups in multiple categories and the weights corresponding to the behavior data in the multiple categories are obtained, and the behavior data and the weights are processed to obtain the behavior feature values corresponding to the historical users of the N age groups, including:
[0018] For the historical users of the N age groups, obtaining the behavior data of the historical users for multiple categories and the weights corresponding to the behavior data;
[0019] Calculating the activity of the historical user in each category according to the behavior data and the weight corresponding to the behavior data;
[0020] According to the distribution of the activity levels in the N age groups, the behavior feature values corresponding to the sample label pairs are determined.
[0021] In some embodiments of the present invention, based on the above scheme, determining the behavior feature value corresponding to the sample label pair according to the distribution of the activity in the N age groups includes:
[0022] Sorting the activities according to the historical user's activities in each category from high to low, and determining the sequence number value corresponding to each activity according to the maximum value of the activities;
[0023] The distribution of the sequence number values in the N age groups is statistically analyzed to determine the behavior feature values corresponding to the sample label pairs.
[0024] In some embodiments of the present invention, based on the above solution, obtaining the historical user's behavior data for multiple categories and the weights corresponding to the behavior data includes:
[0025] Obtaining at least one of browsing data, click data, attention data, shopping cart data, and order data of the historical user for multiple categories as preliminary behavior data;
[0026] determining effective behavior data in the preliminary behavior data;
[0027] The weight corresponding to the behavior data is determined according to the proportion of the effective behavior data to the initial behavior data.
[0028] According to a second aspect of an embodiment of the present invention, a method for predicting a user's age is provided, comprising:
[0029] Obtaining behavior data of a user to be tested on multiple categories and weights corresponding to the behavior data on the multiple categories, and processing the behavior data and the weights to obtain a behavior feature value to be tested corresponding to the user to be tested;
[0030] The behavior feature value to be tested is input into a user age prediction model, and the age prediction of the user to be tested is completed according to the output of the user age prediction model.
[0031] In some embodiments of the present invention, based on the above scheme, obtaining the behavior data of the user to be tested on multiple categories and the weights corresponding to the behavior data on the multiple categories, and processing the behavior data and the weights to obtain the behavior feature value to be tested corresponding to the user to be tested, includes:
[0032] Obtaining behavior data of the user to be tested for multiple categories and weights corresponding to the behavior data;
[0033] Calculating the activity of the user to be tested in each category according to the behavior data and the weights corresponding to the behavior data;
[0034] The behavior feature value to be tested corresponding to the user to be tested is determined according to the activity level.
[0035] According to a third aspect of an embodiment of the present invention, there is provided a device for establishing a user age prediction model, comprising:
[0036] The sample label determination module is used to process the acquired age sample data of massive historical users in a dynamic segmentation manner to obtain N age groups as sample labels, where N is a positive integer;
[0037] A feature value determination module, used to obtain the behavior data of the historical users of the N age groups in multiple categories and the weights corresponding to the behavior data in the multiple categories, and process the behavior data and the weights to obtain the behavior feature values corresponding to the historical users of the N age groups;
[0038] The prediction model determination module is used to train the machine learning model according to the sample labels and the behavior feature values to obtain a user age prediction model.
[0039] According to a fourth aspect of an embodiment of the present invention, there is provided a device for predicting a user's age, comprising:
[0040] The module for acquiring the behavior characteristic value to be tested is used to acquire the behavior data of the user to be tested in multiple categories and the weights corresponding to the behavior data in the multiple categories, and process the behavior data and the weights to obtain the behavior characteristic value to be tested corresponding to the user to be tested;
[0041] The prediction module is used to input the behavior feature value to be tested into the user age prediction model, and complete the age prediction of the user to be tested according to the output of the user age prediction model.
[0042] According to a fifth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for establishing a user age prediction model as described in the first aspect of the above embodiment is implemented, and the method for predicting user age as described in the second aspect of the above embodiment is implemented.
[0043] According to a sixth aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for establishing a user age prediction model as described in the first aspect of the above embodiment, and implement the method for predicting user age as described in the second aspect of the above embodiment.
[0044] The technical solution provided by the embodiment of the present invention may have the following beneficial effects:
[0045] In the technical solutions provided by some embodiments of the present invention, in the process of establishing a user age prediction model, on the one hand, for sample labels: a dynamic segmentation method is used to process the acquired age sample data of massive historical users, so that the N age groups obtained as sample labels are close to the actual situation, overcoming the problem of low prediction accuracy caused by dividing the age groups in a fixed manner; on the other hand, for behavioral feature values: a weighted method is used for behavioral data, so that the behavioral feature values fit the user's actual preference status, which is beneficial to improving the prediction accuracy of the user age prediction model.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings herein are incorporated into and constitute a part of the specification, showing embodiments consistent with the present invention, and together with the specification, are used to explain the principles of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0048] Figure 1 A schematic flow chart of a method for establishing a user age prediction model according to an embodiment of the present invention is shown;
[0049] Figure 2 A schematic diagram showing a flow chart of a method for determining a sample label according to an embodiment of the present invention;
[0050] Figure 3 A schematic flow chart showing a method for determining a behavior characteristic value according to an embodiment of the present invention is shown;
[0051] Figure 4 A schematic flow chart showing a method for determining a behavior characteristic value according to another embodiment of the present invention is shown;
[0052] Figure 5 A schematic flow chart showing a method for determining a behavior characteristic value according to yet another embodiment of the present invention;
[0053] Figure 6 A schematic diagram showing a flow chart of a method for predicting user age according to an embodiment of the present invention;
[0054] Figure 7 A schematic flow chart showing a method for determining a characteristic value of a behavior to be measured according to an embodiment of the present invention is shown;
[0055] Figure 8 A schematic diagram showing the structure of a device for establishing a user age prediction model according to an embodiment of the present invention is shown;
[0056] Fig. 9 A schematic diagram showing the structure of a device for predicting user age according to an embodiment of the present invention is shown;
[0057] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0058] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0059] In addition, the described features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0060] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0061] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0062] In the application scenarios of Internet e-commerce, user groups in the same age group will have certain common characteristics and patterns in their shopping behaviors. By reasonably calculating and transforming user shopping behaviors, extracting core behavioral characteristics, and establishing an age prediction model based on user behaviors, and studying and mining the hidden patterns under user behaviors, we can effectively obtain the age distribution of users, thereby providing them with personalized shopping services and improving their shopping experience.
[0063] In one method of the prior art, age is used as a continuous variable, and a logistic regression model and various variants of the logistic regression model can be used for regression. However, when the user's age prediction is used as a regression problem, people of similar age are more likely to have the same behavioral characteristics, which may lead to a low prediction accuracy of the regression model.
[0064] Another method in the prior art is to use age as a discrete variable or pre-processing segment, and to use Bayesian and its variants, decision trees, etc. for classification. However, when the user's age prediction is used as a classification problem, a fixed segmentation method is generally used to divide the user's age as a model label. Due to the lack of an effective method for dividing the age group, it also affects the improvement of the prediction accuracy.
[0065] Furthermore, in the above-mentioned other method in the prior art, there is a lack of processing of the user's behavioral feature values, so that the prediction effect of the user's age is greatly affected by the initialization state and random components, which affects the improvement of the prediction accuracy.
[0066] Figure 1 The present invention provides a flow chart of a method for establishing a user age prediction model according to an embodiment of the present invention, which at least overcomes the problem of low prediction accuracy of the prediction method provided by the prior art to a certain extent. The execution subject of this embodiment is a device for establishing a user age prediction model, such as a server.
[0067] refer to Figure 1 This embodiment provides a method for establishing a user age prediction model, comprising:
[0068] Step S101, processing the acquired age sample data of massive historical users in a dynamic segmentation manner to obtain N age groups as sample labels, where N is a positive integer;
[0069] Step S102, obtaining behavior data of historical users of the N age groups in multiple categories and weights corresponding to the behavior data in the multiple categories, and processing the behavior data and the weights to obtain behavior feature values corresponding to the historical users of the N age groups; and,
[0070] Step S103: training a machine learning model according to the sample labels and the behavior feature values to obtain a user age prediction model.
[0071] exist Figure 1 In the technical solution provided by the illustrated embodiment, in the process of establishing a user age prediction model, on the one hand, for sample labels: a dynamic segmentation method is adopted to process the acquired age sample data of massive historical users, so that the N age groups obtained as sample labels are close to the actual situation, overcoming the problem of low prediction accuracy caused by the fixed method of dividing age groups; on the other hand, for behavioral feature values: a weighted method of behavioral data is adopted, so that the behavioral feature values are in line with the actual preference status of the user, which is conducive to improving the prediction accuracy of the user age prediction model.
[0072] The following Figure 1 The specific implementation methods of each step of the illustrated embodiment are described in detail:
[0073] Figure 2 The following is a flow chart of a method for determining a sample label according to an embodiment of the present invention. Figure 2 The specific implementation of step S101 is explained. Figure 2 The method includes steps S201 to S204.
[0074] In step S201, age sample data of the massive historical users are collected to obtain an upper age limit and a lower age limit.
[0075] In an exemplary embodiment, the characteristic information of historical users is first obtained. Exemplarily, the characteristic information of users can be obtained based on personal information maintained by the users themselves, for example: the user name of the user's registered email address or other user name contains a number with a numeric pattern of "YYYY" or "YYYYMMDD" to match the user's birthday. Specifically, "YYYY" is used to match the historical user's year of birth, "MM" is used to match the historical user's month of birth, and "DD" is used to match the historical user's day of birth. It should be noted that for overseas sites, the above numeric pattern is modified to "DDMMYYYY".
[0076] Then, the numbers in the matched information that obviously do not match the birthday information are removed, such as the matched year information "3011", the matched month information "21", etc. These data obviously do not belong to the user's birth year, and they are removed as abnormal data. The user's age is calculated based on the information after removing the agenda data, which is used as the sample data of the user age prediction model.
[0077] Furthermore, the upper age limit Max_Age and the lower age limit Min_Age are obtained from the acquired sample data.
[0078] In step S202, a preliminary age range value of each age range is determined according to the preset number N of age ranges and the upper age limit and the lower age limit, wherein the preliminary age range value includes a reference value and a floating value.
[0079] In an exemplary embodiment, the preset number of age groups N is a value set according to actual needs. Determine the reference value of the preliminary age range value for each age group. For example, in the sample data, the upper age limit Max_Age = 58 years old, the lower age limit Min_Age = 8 years old, and the preset number of age groups N = 5, then the reference value of the preliminary age range value for each age group is That is to say, if the age groups are divided in a fixed way, the age range in each age group is 10 years old, that is, 8 to 17 years old is the first age group S 1, 18 to 27 years old is the second age group S 2 ,…,47 to 58 years old is the fifth age group S 5 However, the fixed way of dividing age groups lacks comparison with the actual status, resulting in low prediction accuracy.
[0080] In the technical solution provided in this embodiment, a threshold value is preset, and the floating value of the preliminary age range value is determined together with the reference value of the preliminary age range value. According to the above embodiment, if the threshold value is set to 0.2, the floating value of the preliminary age range value is This embodiment avoids the problem of decreased prediction accuracy of the user age prediction model due to uneven prior distribution of age groups by setting a floating value.
[0081] In step S203, multiple intermediate age range values are determined according to the preliminary age range value with a step length of s, where s is a positive integer. And in step S204, the Gini impurities of the multiple intermediate age range values are calculated, and the intermediate age range value with the smallest Gini impurity is used as the final age range value to complete the determination of the sample label.
[0082] In an exemplary embodiment, in step S203, the step length s is set to 1, and according to the floating value F=8-12 of the preliminary age range value, the five middle age range values are determined to be 8, 9, 10, 11, and 12.
[0083] In step S204, when the step length s takes a value of 1, the first age group is taken as an example for description.
[0084] When the middle age range value is 8, the first age range S 11 For the first age group, S 11 Internal user calculation Gini impurity J 11 , J 11 Used to indicate the first age group S 11 The behavioral similarity of users within a group.
[0085] When the middle age range value is 9, the first age range S 12 For the first age group, S 12 Internal user calculation Gini impurity J 12 , J 12 Used to indicate the first age group S 12 The behavioral similarity of users within a group.
[0086] Similarly, when the middle age range values are 10, 11, and 12, the first age group S13 , S 14 , S 15 Gini impurity, get the corresponding Gini impurity J 13 , J 14 , J 15 .
[0087] Furthermore, the minimum value is obtained from the Gini impurities of multiple intermediate age range values, that is, the age range with the highest user behavior similarity is obtained, and the intermediate age range value corresponding to the minimum Gini impurity is used as the final age range value to complete the determination of the sample label.
[0088] exist Figure 2 In the technical solution provided by the illustrated embodiment, in the process of establishing a user age prediction model, a method of dynamically dividing age groups is implemented by setting a floating value of the age range. Furthermore, the age group with the highest user behavior similarity is obtained by calculating the Gini impurity. The N age groups obtained as sample labels are close to the actual situation, thus overcoming the problem of low prediction accuracy caused by dividing age groups in a fixed manner.
[0089] Continue to view Figure 1 In step S102, the behavior data of the historical users of the N age groups in multiple categories and the weights corresponding to the behavior data in the multiple categories are obtained, and the behavior data and the weights are processed to obtain the behavior feature values corresponding to the historical users of the N age groups.
[0090] In an exemplary embodiment, Figure 3 The following is a flow chart showing a method for determining a behavior feature value according to an embodiment of the present invention. Figure 3 The specific implementation of step S102 is explained. Figure 3 The method includes steps S301 to S303.
[0091] In step S301, for the historical users of the N age groups, the behavior data of the historical users for multiple categories and the weights corresponding to the behavior data are obtained.
[0092] In an exemplary embodiment, Figure 4 FIG. 5 is a flow chart showing a method for determining a behavior feature value according to another embodiment of the present invention, which can be used to explain the specific implementation of step S301. Figure 4 , the method includes, for each age group of historical users:
[0093] Step S401, obtaining at least one of the browsing data, click data, attention data, shopping cart data, and order data of the historical user for multiple categories as preliminary behavior data; step S402, determining valid behavior data in the preliminary behavior data; and, step S403, determining the weight corresponding to the behavior data according to the proportion of the valid behavior data to the initial behavior data.
[0094] In an exemplary embodiment, the above categories may represent different e-commerce categories, including: home appliances, home textiles, furniture, beauty products, etc., but not limited to these; the above preliminary behavioral data may include: number of views, browsing time, number of clicks, whether to follow, whether to add to the shopping cart, whether to place an order, number of recommendations to other users, etc., but not limited to these.
[0095] In an exemplary embodiment, when a product is finally purchased by a user, the initial behavior data of the user before the purchase is valid behavior data. The weight corresponding to the behavior data is the same as the contribution or role of the current behavior data in the model training.
[0096] In step S302, the activity of the historical user in each category is calculated according to the behavior data and the weight corresponding to the behavior data.
[0097] In an exemplary embodiment, the activity L of the historical user Q in each category is calculated by the following formula:
[0098]
[0099] Among them, w ) Indicates the weight corresponding to the behavior data; M represents the number of times a historical user Q acts on category k with behavior i in one day. The types of behavior i include but are not limited to browsing, clicking, following, adding to shopping cart, placing an order, and recommending. k N represents the number of historical user Q's actions in category k; k represents the number of days that historical user Q has acted on category k; L k It represents the historical activity of user Q on category k; P is the number of categories that the user has acted on.
[0100] Continue to refer Figure 3 After determining the activity of historical users in each age group in each category, step S303 is performed. In step S303, the behavior feature value corresponding to the sample label pair is determined according to the distribution of the activity in the N age groups.
[0101] In an exemplary embodiment, Figure 5FIG. 5 is a flow chart showing a method for determining a behavior feature value according to another embodiment of the present invention, which can be used to explain the specific implementation of step S303. Figure 5 , the method includes, for each historical user in each age group:
[0102] Step S501, sorting the activity levels of the historical users in each category in descending order, and determining the serial number value corresponding to each activity level according to the maximum value of the activity level; and, step S502, counting the distribution of the serial number values under the N age groups, and determining the behavioral feature value corresponding to the sample label pair.
[0103] In an exemplary embodiment, for each historical user in each age group, the activity value of each historical user is converted into a serial number value between 0 and 1. For example, in the first age group, the activity of user A is ranked from high to low as follows: 60 (Max_L), 50, 20, 15, 6. The method of converting these activity values into serial numbers can be: using Multiply each activity to get the serial number value corresponding to the activity, which is: 1, 0.83, 0.33, 0.25, 0.1. Similarly, the activity of other users in the first age group is processed in the same way to determine the distribution of the serial number values corresponding to all historical users in the first age group. Furthermore, the distribution of the serial number values corresponding to historical users in each age group can be determined according to the same method.
[0104] In an exemplary embodiment, for the distribution of serial number values corresponding to unique historical users in each age group, the variance of the serial number values is calculated, and only the activity corresponding to the serial number values with a variance greater than the octave is retained to complete the processing of the behavioral feature values in each age group. The technical solution provided in this embodiment uses data to support feature screening, which is conducive to reducing the impact of random components on the prediction results of the user age prediction model; using the number value method to process the activity can solve the problem caused by the different levels of different user behaviors, and is conducive to avoiding the impact of sparse feature matrices and differences in feature values of different users, thereby helping to improve the accuracy of the prediction results of the user age prediction model.
[0105] exist Figure 3-Figure 5 In the technical solution provided by the illustrated embodiment, in the process of establishing a user age prediction model, a weighted behavior data approach is adopted so that the behavior feature values fit the user's actual preference status, thereby facilitating improving the prediction accuracy of the user age prediction model.
[0106] Continue to refer Figure 1 In step S103, according to Figure 2The sample labels determined by the illustrated embodiment, and Figure 3-Figure 5 The behavior feature values determined in the illustrated embodiment are used to train a machine learning model to obtain a user age prediction model.
[0107] In an exemplary embodiment, the machine learning model may be a model supporting classification such as a decision tree, a random forest, or a SVM. The machine learning model may be selected according to actual needs and is not limited here.
[0108] Compared with the aforementioned related methods for establishing user age prediction models, the user age prediction model determined by the technical solution provided in the embodiment has greatly improved recall rate and precision.
[0109] Figure 6 The flowchart of the method for predicting the user's age according to an embodiment of the present invention is shown, which can overcome the problem of low prediction accuracy of the prediction method provided by the prior art to a certain extent. The execution subject of this embodiment is a device for predicting the user's age, such as a server.
[0110] refer to Figure 6 The method for predicting the user's age provided in this embodiment includes:
[0111] Step S601, obtaining behavior data of a user to be tested on multiple categories and weights corresponding to the behavior data on the multiple categories, and processing the behavior data and the weights to obtain a behavior feature value to be tested corresponding to the user to be tested; and
[0112] Step S602: input the behavior feature value to be tested into a user age prediction model, and complete the age prediction of the user to be tested according to the output of the user age prediction model.
[0113] In an exemplary embodiment, Figure 7 FIG. 5 is a flow chart showing a method for determining a characteristic value of a behavior to be tested according to an embodiment of the present invention, which can be used to explain the specific implementation of step S601. Figure 7 The method includes steps S701 to S703.
[0114] In step S701, the behavior data of the user to be tested for multiple categories and the weights corresponding to the behavior data are obtained; in step S702, the activity of the user to be tested in each category is calculated based on the behavior data and the weights corresponding to the behavior data; and, in step S703, the behavior feature value to be tested corresponding to the user to be tested is determined based on the activity.
[0115] because Figure 7 The method for determining the characteristic value of the behavior to be measured in the embodiment shown is Figure 3The specific implementation methods of the illustrated embodiment correspond to those of the embodiment shown in the drawings, and therefore will not be described in detail here.
[0116] In an exemplary embodiment, the user age prediction model is based on Figure 1-Figure 5 Therefore, the method for establishing the user age prediction model in step S602 can refer to Figure 1-Figure 5 The illustrated embodiments will not be described in detail here.
[0117] The following describes an embodiment of a device for establishing a user age prediction model of the present invention, which can be used to perform the above-mentioned Figures 1 to 5 The method for establishing the user age prediction model is shown.
[0118] Figure 8 FIG. 1 shows a schematic diagram of a device for establishing a user age prediction model according to an embodiment of the present invention, referring to FIG. Figure 8 The device 800 for establishing a user age prediction model includes: a sample label determination module 801, a feature value determination module 802 and a prediction model determination module 803.
[0119] The sample label determination module 801 is used to process the acquired age sample data of a large number of users in a dynamic segmentation manner to obtain N age groups as sample labels, where N is a positive integer;
[0120] The feature value determination module 802 is used to obtain the behavior data of the users of the N age groups in multiple categories and the weights corresponding to the behavior data in the multiple categories, and process the behavior data and the weights to obtain the behavior feature values corresponding to the users of the N age groups;
[0121] The prediction model determination module 803 is used to train a machine learning model according to the sample labels and the behavior feature values to obtain a user age prediction model.
[0122] In some embodiments of the present invention, based on the above-mentioned solution, the sample label determination module 801 includes: a statistical unit, a preliminary age range value determination unit, an intermediate age range value determination unit and a sample label determination unit.
[0123] The statistical unit is used to collect statistics of age sample data of the massive users to obtain an upper age limit and a lower age limit;
[0124] The preliminary age range value determination unit is used to determine the preliminary age range value of each age range according to the preset number N of age ranges and the upper age limit and the lower age limit, wherein the preliminary age range value includes a reference value and a floating value;
[0125] The intermediate age range value determination unit is used to: determine a plurality of intermediate age range values according to the preliminary age range value with a step length of s, wherein s is a positive integer;
[0126] The sample label determination unit is used to calculate the Gini impurity of the multiple intermediate age range values, and use the intermediate age range value with the smallest Gini impurity as the final age range value to complete the determination of the sample label.
[0127] In some embodiments of the present invention, based on the above-mentioned solution, the characteristic value determination module 802 includes: an acquisition unit, a calculation unit and a determination unit.
[0128] The acquisition unit is used to: for users of the N age groups, acquire the behavior data of the users for multiple categories and the weights corresponding to the behavior data;
[0129] The calculation unit is used to: calculate the activity of the user in each category according to the behavior data and the weight corresponding to the behavior data;
[0130] The determination unit is used to determine the behavior feature value corresponding to the sample label pair according to the distribution of the activity level in the N age groups.
[0131] In some embodiments of the present invention, based on the above solution, the determining unit is specifically configured to:
[0132] The activities of the users in each category are sorted in descending order, and the serial number value corresponding to each activity is determined according to the maximum value of the activity; and the distribution of the serial number values under the N age groups is statistically analyzed to determine the behavioral feature value corresponding to the sample label pair.
[0133] In some embodiments of the present invention, based on the above solution, the acquisition unit is specifically used to:
[0134] Obtain at least one of the user's browsing data, click data, attention data, shopping cart data, and order data for multiple categories as preliminary behavior data; determine valid behavior data in the preliminary behavior data; and determine the weight corresponding to the behavior data based on the proportion of the valid behavior data to the initial behavior data.
[0135] Since the functional modules of the device for establishing the user age prediction model in the exemplary embodiment of the present invention are similar to the above Figures 1 to 5 The steps of the exemplary embodiment of the method for establishing the user age prediction model shown in the figure correspond to those of the exemplary embodiment of the method for establishing the user age prediction model shown in the figure. Therefore, for details not disclosed in the embodiment of the device for establishing the user age prediction model of the present invention, please refer to the above-mentioned embodiment of the present invention. Figures 1 to 5An embodiment of a method for establishing a user age prediction model is shown.
[0136] The following describes an embodiment of the user age prediction device of the present invention, which can be used to perform the above-mentioned Figure 5 , Figure 6 A method for predicting user age.
[0137] Fig. 9 FIG. 1 is a schematic diagram showing a structure of a device for predicting user age according to an embodiment of the present invention, referring to FIG. Fig. 9 , the prediction of user age 900 includes: a module 901 for acquiring the characteristic value of the behavior to be tested and a prediction module 902 .
[0138] The behavior feature value acquisition module 901 is used to acquire the behavior data of the user to be tested on multiple categories and the weights corresponding to the behavior data on the multiple categories, and process the behavior data and the weights to obtain the behavior feature value to be tested corresponding to the user to be tested;
[0139] The prediction module 902 is used to input the behavior feature value to be tested into the user age prediction model, and complete the age prediction of the user to be tested according to the output of the user age prediction model.
[0140] In some embodiments of the present invention, based on the above solution, the behavior characteristic value acquisition module 901 to be tested is specifically used for:
[0141] Obtaining the behavior data of the user to be tested for multiple categories and the weights corresponding to the behavior data; calculating the activity of the user to be tested in each category based on the behavior data and the weights corresponding to the behavior data; and determining the behavior feature value to be tested corresponding to the user to be tested based on the activity.
[0142] Since the functional modules of the user age prediction device according to the exemplary embodiment of the present invention are similar to the above Figure 5 , Figure 6 The steps of the exemplary embodiment of the method for predicting the user age shown in FIG. 1 correspond to those of the exemplary embodiment of the method for predicting the user age shown in FIG. 1 , so for details not disclosed in the embodiment of the device for predicting the user age of the present invention, please refer to the above-mentioned embodiments of the present invention. Figure 5 , Figure 6 An embodiment of a method for predicting a user's age is shown.
[0143] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of an electronic device suitable for implementing an embodiment of the present invention. Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0144] like Figure 5As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. Various programs and data required for system operation are also stored in the RAM 1003. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0145] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0146] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present application are executed.
[0147] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of boxes in the block diagram or flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] The units involved in the embodiments of the present invention may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, limit the units themselves.
[0150] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the data processing method described in the above embodiment.
[0151] For example, the electronic device can implement Figure 1 As shown in: Step S101, process the acquired age sample data of massive historical users by dynamic segmentation to obtain N age groups as sample labels, where N is a positive integer; Step S102, obtain the behavior data of the historical users of the N age groups in multiple categories and the weights corresponding to the behavior data in the multiple categories, and process the behavior data and the weights to obtain the behavior feature values corresponding to the historical users of the N age groups; Step S103, train a machine learning model according to the sample labels and the behavior feature values to obtain a user age prediction model.
[0152] For example, the electronic device can achieve Figures 2 to 7 The steps shown in any figure.
[0153] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0154] Through the description of the above implementation modes, it is easy for those skilled in the art to understand that the example implementation modes described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation mode of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation mode of the present invention.
[0155] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0156] It should be understood that the present invention is not limited to the exact construction that has 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 invention is limited only by the appended claims.
Claims
1. A method for establishing a user age prediction model, characterized in that: include: Count the age sample data of massive historical users to obtain the upper and lower age limits; Determine a preliminary age range value for each age range according to the number N of preset age ranges and the upper and lower age limits, wherein the preliminary age range value includes a reference value and a floating value; Taking s as a step length, determining a plurality of intermediate age range values according to the preliminary age range values, wherein s is a positive integer; Calculate the Gini impurity of the multiple middle age range values, and use the middle age range value with the smallest Gini impurity as the final age range value, so as to obtain N age ranges as sample labels, where N is a positive integer; Obtaining behavior data of historical users of the N age groups in multiple categories and weights corresponding to the behavior data in the multiple categories, and calculating the activity of the historical users in each category according to the behavior data and the weights corresponding to the behavior data; Sorting the activities according to the historical user's activities in each category from high to low, and determining the sequence number value corresponding to each activity according to the maximum value of the activities; Counting the distribution of the sequence number value in the N age groups, and determining the behavior feature value corresponding to the sample label; A machine learning model is trained according to the sample labels and the behavior feature values to obtain a user age prediction model.
2. The method according to claim 1, characterized in that Obtaining the historical user's behavior data for multiple categories and the weights corresponding to the behavior data, including: Obtaining at least one of browsing data, click data, attention data, shopping cart data, and order data of the historical user for multiple categories as preliminary behavior data; determining effective behavior data in the preliminary behavior data; The weight corresponding to the behavior data is determined according to the proportion of the effective behavior data to the initial behavior data.
3. A method for predicting user age based on a user age prediction model established by the method according to claim 1 or 2, characterized in that: include: Obtaining behavior data of a user to be tested on multiple categories and weights corresponding to the behavior data on the multiple categories, and processing the behavior data and the weights to obtain a behavior feature value to be tested corresponding to the user to be tested; The behavior feature value to be tested is input into a user age prediction model, and the age prediction of the user to be tested is completed according to the output of the user age prediction model.
4. The method according to claim 3, characterized in that Obtaining behavior data of a user to be tested on multiple categories and weights corresponding to the behavior data on the multiple categories, and processing the behavior data and the weights to obtain a behavior feature value to be tested corresponding to the user to be tested, including: Obtaining behavior data of the user to be tested for multiple categories and weights corresponding to the behavior data; Calculating the activity of the user to be tested in each category according to the behavior data and the weights corresponding to the behavior data; The behavior feature value to be tested corresponding to the user to be tested is determined according to the activity level.
5. A device for establishing a user age prediction model, characterized in that: include: The sample label determination module is used to count the age sample data of massive historical users and obtain the upper and lower age limits; Determine a preliminary age range value for each age range according to the number N of preset age ranges and the upper and lower age limits, wherein the preliminary age range value includes a reference value and a floating value; Taking s as a step length, determining a plurality of intermediate age range values according to the preliminary age range values, wherein s is a positive integer; Calculate the Gini impurity of the multiple middle age range values, and use the middle age range value with the smallest Gini impurity as the final age range value, so as to obtain N age ranges as sample labels, where N is a positive integer; A feature value determination module is used to obtain the behavior data of the historical users of the N age groups on multiple categories and the weights corresponding to the behavior data on the multiple categories, calculate the activity of the historical users on each category according to the behavior data and the weights corresponding to the behavior data; sort the activity in descending order according to the activity of the historical users on each category, and determine the serial number value corresponding to each activity according to the maximum value of the activity; count the distribution of the serial number value under the N age groups, and determine the behavior feature value corresponding to the sample label; The prediction model determination module is used to train the machine learning model according to the sample labels and the behavior feature values to obtain a user age prediction model.
6. A device for predicting user age, characterized in that: include: The module for acquiring the behavior characteristic value to be tested is used to acquire the behavior data of the user to be tested in multiple categories and the weights corresponding to the behavior data in the multiple categories, and process the behavior data and the weights to obtain the behavior characteristic value to be tested corresponding to the user to be tested; A prediction module, used for inputting the behavior feature value to be tested into a user age prediction model, and completing age prediction of the user to be tested according to the output of the user age prediction model; Wherein, the user age prediction model is established based on the method described in claim 1 or 2.
7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the method for establishing a user age prediction model as described in claim 1 or 2, and implements the method for predicting user age as described in claim 3 or 4.
8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for establishing a user age prediction model as described in claim 1 or 2, and to implement the method for predicting user age as described in claim 3 or 4.
Citation Information
Patent Citations
Method, system and terminal for predicting age characteristics based on decision tree model
CN106503863A
User age group estimation method and apparatus, and electronic device
CN108335131A