User profiling method and system based on predictable user characteristic attributes
By building a user terminal feature database and using the XGBoost algorithm to predict user gender and age, the data one-sidedness and closedness in the existing technology are solved, and the accuracy of user portraits and personalized recommendation effects are achieved.
Patent Information
- Application Number
- CN202110327165.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-03-12
- Filing Date
- 2021-03-26
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-03-26
AI Technical Summary
The existing user portrait construction methods have data one-sidedness and data closure problems, making it difficult to accurately understand user behavior preferences across the entire network, especially in the Internet industry, which cannot accurately predict user gender and age, which affects the effect of data mining and personalized recommendations. .
By constructing a feature database of Internet user terminals, using the XGBoost algorithm to encode and train user gender and age groups feature matrix, predict user gender and age groups, and generate multi-dimensional interest tags based on region, city level and consumption level to build user portraits.
It realizes accurate prediction of user gender and age, improves the accuracy of user portraits and the effect of personalized recommendations, and provides a good data foundation for precise marketing and personalized services.
Smart Images

Figure CN114358807B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer processing technology, and in particular to a user profiling method and system based on predictable user feature attributes. Background Art
[0002] User portraits are an effective tool for outlining target users and linking user demands with design directions. They have been widely used in various fields. The process of building user portraits is essentially the process of describing virtual user groups with short texts (or pictures). It can be understood as abstracting user characteristics into short phrase tags. The same short phrase tag can be considered to have similar goals, needs, and behaviors. There are two types of user portrait construction processes on the market: one is that product designers and operators abstract typical users from user groups based on user needs, and the other is to generate a set of tags describing users based on each user's behavior, opinions, and other data in products and services. In specific implementation, user portraits are used as a set of tags used to characterize user characteristics, such as static attributes such as age and gender, and of course, user interest characteristics such as travel and clothing can also be included. The construction and update of user portraits are of great significance for the subsequent targeted dissemination of information, such as targeted advertising.
[0003] User portraits on the market are generally expressed as feature labels generated by user browsing, purchasing, using and other behaviors, that is, based on the user's behavior on the site, for example, the behavior logs of the media categories and product categories visited are saved, and then within a certain time window, all user behavior logs are traversed, and they are calculated according to a certain weight decay function to obtain user feature labels. For example, the feature labels include: user preference feature labels and user basic attribute feature labels, and user preference feature labels obtained based on content delivery analysis on smart terminals. Through statistical analysis and other methods, the data sources and corresponding labels of user basic attributes (user's gender, age group, place of birth, etc.) are mostly predicted and estimated, and the current latest user portrait is obtained.
[0004] The inventor of this application found that the problem with this method is that the data obtained is very one-sided. For example, the user data on the site knows nothing about the user's access behavior on other websites; at the same time, it is difficult for the Internet industry to register users with real names, so user static attributes such as age and gender can only be guessed through relevant statistical algorithms, which are not very reliable. The user data of data holders of various existing applications are basically closed, and the data islands cannot be shared at the network level. This makes it impossible for data users to accurately understand users' behavioral preferences across the entire network and conduct personalized data mining based on their industry needs, which causes certain difficulties in generating user portraits that meet industry applications. Summary of the invention
[0005] The present application solves the problems of one-sidedness of user access data and data closure between applications in the prior art by providing a user portrait method and system based on predictable user feature attributes, and achieves the technical effect of predicting the user's gender and age based on the applications installed on the user terminal. The application further constructs a user portrait based on the known tags of the user terminal, so as to achieve the beneficial effect of implementing accurate recommendations for each user terminal.
[0006] In a first aspect, an embodiment of the present application provides a user profiling method based on predictable user feature attributes, the method comprising:
[0007] S1: Build a feature database of Internet user terminals, obtain multiple applications installed on each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes including gender and age reported in each application, and then automatically merge them according to the predetermined labels to unify the categories;
[0008] S2: Obtain some sample data from the user feature database, and use age group characteristics and gender characteristics as labels to mark the sample data respectively;
[0009] S3: Based on the age group feature, one-hot encode the application list in the labeled data to obtain an age-based feature matrix; based on the gender feature, one-hot encode the application list in the labeled data to obtain a gender-based feature matrix; the age-based feature matrix and / or the gender-based feature matrix are used as feature inputs of the subsequent XGBoost algorithm, thereby forming a certain amount of sample data for predicting the characteristic attributes of the user terminal;
[0010] S4: Use the XGBoost algorithm and improve its applicability to train the model using the acquired sample data; train the feature matrix of age group and the feature matrix of gender using the XGBoost algorithm, and obtain the prediction model of age group and gender after training;
[0011] S5: Based on the age prediction model and the gender prediction model, predict the user's age and gender for any application installed on the user terminal, obtain the user's age and gender, and based on user characteristic attributes including one or more of the region, city level, terminal type, and consumption level, form multi-dimensional interest tags for the user and construct a user portrait to make accurate recommendations to the user.
[0012] Furthermore, in step S3, the method of obtaining the feature matrix based on age groups includes:
[0013] S31: One-hot encode the application of each user terminal, encode the installed application as 1, and encode the uninstalled application as 0, and obtain the feature matrix (1) of the application installed by all user terminals in the labeled data:
[0014]
[0015] S32: Substitute the age group feature into the matrix (1) to obtain the feature matrix (2), which is expressed as follows:
[0016]
[0017] S33: Substitute the user attribute weights of each application based on the age group characteristics into the matrix (2) to obtain the age group-based feature matrix (3), which is expressed as follows:
[0018]
[0019] Furthermore, in step S3, the method of obtaining the gender-based feature matrix includes:
[0020] S34: Substitute the gender feature into the matrix (1) to obtain the feature matrix (4), which is expressed as follows:
[0021]
[0022] S35: Substitute the gender-based user attribute weights of each application into the matrix (4) to obtain the gender-based feature matrix (5), which is expressed as follows:
[0023]
[0024] Furthermore, in step S4, the method of training the feature matrix of age group and the feature matrix of gender by XGBoost algorithm to obtain the prediction model of age group and gender includes:
[0025] S41: Receive a labeled sample data set, the sample data set includes n user terminals, each user terminal includes m feature data, and the sample data set is expressed as: D = {(x i ,y i )}(|D|= n, xi∈Rm, yi∈R;
[0026] S42: Perform model training of the XGboost algorithm on the feature matrix of the age group and / or the feature matrix of the gender, train k trees in the XGboost algorithm, and finally obtain a CART decision tree consisting of k trees through the XGboost algorithm training: k (x) = ω q (x) The integrated model obtained by adding them together is used as the prediction model for age group and gender, where the output of the model represents the prediction of age group or gender. The prediction model is expressed as:
[0027]
[0028] represents the output of the XGBoost model, Γ is the regression tree space, represents the set of CART decision trees, and is defined as: Γ={f(x)=ω a (x)}(q:R m →T,ω∈R T );
[0029] Where f(x) represents a CART decision tree, which consists of a tree structure q and T leaf nodes. q represents the index of each tree structure mapped to the corresponding leaf node, x represents a user terminal, q(x) represents the leaf node where the user terminal is located, and each leaf node has a continuous value corresponding to it called the weight of the leaf node ω, ω q (x) is the output of the regression tree for the sample data, representing the value of each terminal user and used as the predicted value. k Corresponding to an independent tree structure q and its leaf node weight ω, all the weights constitute the weight vector ω∈R of the tree T ;
[0030] The tree structure q maps any sample data with m-dimensional feature attributes to one of the leaf nodes through the feature attribute discrimination of the user terminal; each decision tree function f kCorresponding to a unique tree structure q and the corresponding leaf node weight vector ω; for a sample data, the XGBoos model obtains the final prediction value The process is: map the sample to the corresponding leaf node in each decision tree, and then add the weights of the k leaf nodes corresponding to the sample;
[0031] The XGboost objective function used by the XGboost algorithm is:
[0032]
[0033] Among them, the XGboost objective function is used to measure the deviation between the predicted value and the true value of the model. During the training process, the XGboost objective function is used to make the objective function value as small as possible; represents the predicted value, y i represents the target value; l represents the training objective function, which is used to measure the predicted value and the target value y i The deviation between them is a regular term used to control the complexity of model training and is defined as: Ω represents the model complexity penalty term, γ and λ represent the penalty coefficients, and T represents the number of leaf nodes; ||ω|| 2 Represents the square of the output score of each tree leaf node, which is equivalent to L2 regularization.
[0034] Furthermore, before step S3, after receiving the labeled data, based on the application list in the labeled data, the top N applications are screened out, N≥3000, and user terminals with 5 or more applications installed are recorded as user terminals that can implement one-hot encoding.
[0035] In a second aspect, an embodiment of the present application provides a system for a user profiling method based on predictable user feature attributes as described in any one of the first aspects, including:
[0036] A database module is configured to build a feature database of Internet user terminals, obtain the applications installed by each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes including gender and age reported in each application, and then automatically merge them according to the labels to unify the categories;
[0037] A preprocessing module is configured to obtain a number of sample data from a user feature database, and use age group features and gender features as labels to mark the sample data respectively;
[0038] The feature encoding module is configured to perform one-hot encoding on the application list in the labeled data based on the age group feature to obtain an age group-based feature matrix; perform one-hot encoding on the application list in the labeled data based on the gender feature to obtain a gender-based feature matrix; use the age group-based feature matrix and / or the gender-based feature matrix as feature inputs of a subsequent XGBoost algorithm, thereby forming a certain amount of sample data for predicting feature attributes of a user terminal;
[0039] The model training module is configured to use the XGBoost algorithm and improve its applicability, and to train the model using the acquired sample data; the feature matrix of the age group and the feature matrix of the gender are input into the preset XGboost model, and the prediction model of the age group and the gender is obtained after training;
[0040] The portrait generation module is configured to predict the user's age group and gender for any application installed on the user terminal based on the age group prediction model and the gender prediction model, obtain the user's age group and gender, and at the same time, based on user characteristic attributes including one or more of the region, city level, terminal type, and consumption level, form multi-dimensional interest tags for the user, and construct and generate a user portrait in order to make accurate recommendations to the user.
[0041] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0042] one or more memories for storing executable program code;
[0043] a processor, connected to the memory, for storing one or more programs;
[0044] The executable program code is read and a computer program corresponding to the executable program code is run to execute the user profiling method based on predictable user feature attributes as described in any one of the first aspects.
[0045] In a fourth aspect, an embodiment of the present application provides a storage medium comprising: an executable program code stored therein, and at least one processor reads the executable program code to run a computer program corresponding to the executable program code to execute a user profiling method based on predictable user feature attributes as described in any one of the first aspects.
[0046] The multiple technical solutions provided in the embodiments of the present application have at least the following technical effects:
[0047] 1. The present invention generates user portraits by predicting user characteristic attributes including age group and gender, combining them with characteristics such as user location, city level, phone model, user behavior, and consumption level, and provides a good data foundation for many aspects such as precision marketing, personalized services, and network public opinion management.
[0048] 2. The present invention utilizes the boosting tree algorithm idea in the XGboost model and applies it to age and gender prediction, which improves the prediction accuracy and can generate user portraits more accurately.
[0049] 3. The present invention collects data from user terminals on the Internet through the networking actions of each user terminal, collects user terminals and corresponding applications, thereby obtaining the application installation list reported by the user terminal, and collects its location, city level, model, user consumption level, etc.; and obtains the top N APPs with the most covered users, annotates their age stage, gender, etc., and performs data preprocessing.
[0050] 4. The present invention uses the data of the list of APPs used by users with marked age and gender, and uses the XGboost algorithm to train based on existing data to obtain age prediction models and gender prediction models. When obtaining relevant data, if the age and gender are unknown, the age and gender can be predicted based on this module, providing a good foundation for accurate user portraits.
[0051] 5. The present invention performs relevant user analysis by predicting age groups and genders in combination with relevant information provided by users, generates multiple tags for users, and constructs user portraits that meet the needs of different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flow chart of a user profiling method based on predictable user feature attributes in Embodiment 1 of the present application;
[0053] Figure 2 This is a schematic diagram of the same user installing an application developed by the same software company in Embodiment 1 of the present application;
[0054] Figure 3 This is a flow chart of a user portrait system based on predictable user feature attributes in Example 2 of the present application. DETAILED DESCRIPTION
[0055] The background technology further adds that building user portraits can be based on different mechanisms.
[0056] User portrait construction method based on design and thinking: Through questionnaires, interviews and other methods, understand the commonalities and differences of users, analyze and design different user portraits. In view of the inherent particularity and complexity of this construction method, research usually proposes specific construction processes from four perspectives: goal-oriented perspective, role-oriented perspective, participation-oriented perspective and fiction-oriented perspective. Among them, the common point of the goal-oriented perspective, role-oriented perspective and participation-oriented perspective is that the construction process is based on data, while the fiction-oriented perspective is not based on data, but only relies on the intuition and assumptions of designers. Among them, the goal-oriented perspective can concentrate design ideas and complete discussions as a communication tool, but it underestimates the value of user participation.
[0057] Ontology- or concept-based user portrait construction method: The ontology-based method considers existing literature, applications, and ontologies related to user context information and summary information, and studies the user portrait method in the academic paper recommendation system. Users are represented as subject-based ontologies, and articles are converted into corresponding word vectors and matched with values. The concept-based method is based on search engine logs and click records, and uses ranking learning methods to construct concept-based user portraits, in which concept vectors have both positive and negative values. However, its limitations are that it is necessary to construct corresponding ontology structures for different fields, require expert participation, and is time-consuming, labor-intensive, and costly.
[0058] The user portrait construction method based on subject or topic, the construction method based on theme, uses the naive Bayes, LDA method and other algorithms to classify the user's topic to represent the user. The construction method based on topic, by using the user's related text and topic feature information to build, gathers a group of people who are interested in the same topic together to obtain the information of this group of people, and then uses the algorithm to extract the label of this group of people, but it is impossible to really introduce the characteristics of the user itself into the model, and there may be deviations when analyzing positive and negative emotions.
[0059] The construction method based on interests or preferences uses the information that users frequently browse or pay attention to to characterize users. It can make full use of the similar interests and preferences of different users, summarize a variety of user portrait construction methods based on user interests, and on this basis propose a method of constructing user portraits based on two types of information: descriptive information of users' favorite products and the interaction duration of users with specific products. It dynamically adjusts user preferences according to users' search behaviors, and uses weighted vocabulary to represent users' preference profiles. It also verifies the effectiveness of dynamics in the search system. However, it cannot handle the dynamics and real-time nature of users' interests and hobbies well; it can only estimate users' interests and preferences from limited historical behaviors.
[0060] Based on multi-dimensional or fusion construction methods, users are characterized from multiple dimensions through data of multiple feature types, and text features and social features are used to build user portraits and conduct age classification research. In response to the problem of user gender inference on some platforms, a new name classifier is proposed, instead of relying solely on a name database, to extract features from user names and use these feature names to assign a gender. Existing researchers have proposed a multi-perspective fusion framework to build user portraits, using dual channels to model and predict users with different characteristics separately, and proposed a variety of feature extraction methods for different types of data to build a multi-source feature system for users (including categories, clustering features, and numerical features, etc.), but the calculation is large and complex.
[0061] Based on the various defects of the above-mentioned method for constructing user portraits, this application proposes a user portrait method based on predictable user feature attributes. In order to better understand the technical solution, the above-mentioned technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods of the specification.
[0062] Embodiment 1
[0063] refer to Figure 1 As shown, the embodiment of the present application provides a user profiling method based on predictable user feature attributes, which specifically includes the following steps:
[0064] Step S1: Build a feature database of Internet user terminals, obtain multiple applications installed on each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes including gender and age reported in each application, and then automatically merge them according to predetermined tags to unify the categories.
[0065] Among them, reference Figure 2As shown, regarding how to obtain the applications on each terminal, the embodiment of the present application is based on multiple applications developed by the software company, because the same user may install multiple applications developed by the software company. Therefore, it can be understood that the software company sets up different databases for the content of the application and the user data, such as {application 1 database, application 2 database, application 3 database, ..., user data}. Furthermore, when any user installs an application, a pop-up window will appear to indicate that user authorization is required. The authorization confirmation action is to obtain some relevant information of the terminal through the installation of the application. For example, after installing the chat and dating social software "Light and Sweet", the user will download and install it, and there will be a pop-up window to display the user agreement, privacy terms and permission instructions. If the user allows the installation, the software company will collect the required information. The embodiment of the present application uses the software company's own user database, that is, integrates the user information required by the server of each application, and uses the technology of the embodiment of the present application to facilitate advertising. Then, after using user classification, high-value users are screened out to facilitate advertising optimization.
[0066] This embodiment is based on the analysis of massive user terminal data in open source big data, and predicts the gender and age group of the user to whom the user terminal belongs for the application installed on each user terminal, and combines other relevant attributes of the user terminal to make accurate recommendations to the user on the user terminal. Other relevant attributes can be but are not limited to region, city level, terminal type, and consumption level. It can be understood that after predicting the gender and age group of the user terminal based on the registered application on the user terminal, other user characteristic attributes are further determined based on the user terminal ID. Of course, it can also be understood that based on the known user terminal ID, the user characteristic attributes that can be obtained by the unregistered application can be obtained. Further, the data structure displayed by each user terminal is {user terminal ID, application = {APP1, APP2, APP3, ..., APPN}, age ID, gender, region, city level, terminal type, consumption level ...}. Of course, the application includes but is not limited to APP and WeChat applets.
[0067] In this step, different user attribute weights are specified for different applications. It can be understood that each application locates a relatively stable user group according to user needs in the early stage of development. For a stable user group, the proportion of various attributes of users in the entire user group should be a stable value. For example, in the user group of an application, male users account for 56% of all users, while female users account for 44% of all users. Based on this, a fixed user attribute weight is determined for each application in this embodiment. Of course, this determination can be determined based on experience or based on actual statistical calculations of the user group. Further, the user attribute weights in this embodiment include but are not limited to gender weights and age group weights. Gender weight refers to the proportion of male users and female users in the overall user group. Age group weight refers to the proportion of users in different age groups in the overall user group. The user attribute weight specified by a specific application is specifically the following data structure: {application ID, application name, male user ratio, female user ratio, age group 1 user ratio, age group 2 user ratio...}.
[0068] Step S2: Obtain some sample data from the user feature database, and use age group characteristics and gender characteristics as labels to mark the sample data respectively.
[0069] This step uses age data and gender data as labels for labeling. Furthermore, it also includes segmenting the age data, and the age data is divided into multiple categories by segmentation. Preferably, the age data is divided into 6 segments to obtain 6 types of age group data: 0-17 years old, 18-24 years old, 25-34 years old, 35-44 years old, 45-55 years old, and over 55 years old. Before step S1, it also includes classifying the gender data: male, female. The age data segmentation is shown in Table 1 below.
[0070] Age Group ID illustrate AGE1 0-17 years old AGE2 18-24 years old AGE3 25-34 years old AGE4 35-44 years old AGE5 45-55 years old AGE6 Over 55 years old
[0071] Table 1
[0072] In this step, when preprocessing the sample data, the age characteristics and gender characteristics in the sample data are extracted, and each age characteristic is segmented and labeled. The age group category is labeled according to the age characteristics, and the gender characteristics are labeled as male or female. Each sample data can have the following data structure {user terminal ID, AGEID, gender, APPID...}. It can be seen that each sample data includes age group characteristics and gender characteristics. The application corresponding to the age group characteristics and the application corresponding to the gender characteristics can be extracted respectively. Each labeled sample has the following data structure {user terminal ID, AGEID, APP1, APP2, APP3,..., APPN}, {user terminal ID, gender, APP1, APP2, APP3,..., APPN}.
[0073] Step S3: Based on the age group characteristics, one-hot encode the application list in the labeled data to obtain an age-based feature matrix; based on the gender characteristics, one-hot encode the application list in the labeled data to obtain a gender-based feature matrix; use the age-based feature matrix and / or the gender feature matrix as feature input for the subsequent XGBoost algorithm, thereby forming a certain amount of sample data for predicting the characteristic attributes of the user terminal.
[0074] Before step S3, after receiving the labeled data, the method further includes screening out the top N applications based on the application list in the labeled data, where N≥3000, and recording user terminals with 5 or more applications installed as user terminals that can implement one-hot encoding.
[0075] Each user terminal is shown in the data structure {application ID, user terminal ID}, and further statistics and merger are shown in the data structure {application ID, number of users}, so as to filter out the top N applications. Of course, it is not limited to this, and can also include application ID and application name.
[0076] Record the user terminals that have installed 5 or more applications, of course not limited to 5. After experimental testing, the preferred parameter is 5. When there are at least 5 user terminals, the gender and age group of the user can be predicted. The user terminal that implements the prediction can have the following data structure {user terminal ID, application 1, application 2, application 3, ...}.
[0077] Furthermore, in step S3, the method of obtaining the feature matrix based on age groups includes:
[0078] S31: One-hot encode the application of each user terminal, encode the installed application as 1, and encode the uninstalled application as 0, and obtain the feature matrix (1) of the application installed by all user terminals in the labeled data:
[0079]
[0080] S32: Substitute the age group feature into the matrix (1) to obtain the feature matrix (2), which is expressed as follows:
[0081]
[0082] S33: Substitute the user attribute weights of each application based on the age group characteristics into the matrix (2) to obtain the age group-based feature matrix (3), which is expressed as follows:
[0083]
[0084] For example, a user terminal user1 has an age of 26 marked on the application installed, which belongs to AGE3 and is in the age group of 25-34 years old. The applications installed on the user terminal are application 1, application 2, ..., application N, and each application is coded {1, 1, 0, ..., 0}, which can be further expressed as {user1, 1, 1, 0, ..., 0}. In the feature matrix of applications in the corresponding age group, installed applications are coded as 1, and uninstalled applications are coded as 0. This is also true for applications on other user terminals in different age groups. In the preset feature matrix, the weight of each application is 1 by default and is adjusted according to the specific scenario. If the weight of application 1 in the application list in this step in the feature matrix is 0.5, then multiply it by 0.5 at the corresponding code, and so on for other applications. The feature matrix for the corresponding age group is as follows:
[0085] Further as follows:
[0086] In this step, if the weight of APP1 in the application program in the feature matrix is 0.5, the feature matrix becomes:
[0087] Further conversion yields:
[0088]
[0089] In step S3, the method of obtaining the gender-based feature matrix includes:
[0090] S34: Substitute the gender feature into the matrix (1) to obtain the feature matrix (4), which is expressed as follows:
[0091]
[0092] S35: Substitute the gender-based user attribute weights of each application into the matrix (4) to obtain the gender-based feature matrix (5), which is expressed as follows:
[0093]
[0094] Furthermore, based on the gender category classification, the application list in the annotated data is one-hot encoded to obtain the feature matrix of the gender category. Based on the installed applications in each gender category, for example, user A's terminal ID = 1, the deformation marked on the application of his terminal is male, and the applications of the terminal are application 1, application 2, application 3... application N. In the feature matrix of the application in the corresponding gender category, the installed application is coded as 1, and the uninstalled application is coded as 0. And in the feature matrix of the gender category, if the weight of each application is 1 by default, it is adjusted according to the specific scenario. The feature matrix of the corresponding gender category is as follows:
[0095]
[0096] Step S4: Use the XGBoost algorithm and make applicability improvements to train the model using the acquired sample data; train the feature matrix of age group and the feature matrix of gender using the XGBoost algorithm, and obtain the prediction model of age group and gender after mature training.
[0097] Further, in step S4, the method of training the feature matrix of age group and the feature matrix of gender by XGBoost algorithm to obtain the prediction model of age group and gender includes:
[0098] S41: Receive a labeled sample data set, the sample data set includes n user terminals, each user terminal includes m feature data, and the sample data set is expressed as: D = {(x i ,y i )}(|D|= n, xi∈Rm, yi∈R.
[0099] S42: Perform model training of the XGboost algorithm on the feature matrix of the age group and / or the feature matrix of the gender, train k trees in the XGboost algorithm, and finally obtain a CART decision tree consisting of k trees through the XGboost algorithm training: k (x) = ω q (x)The integrated model obtained by adding them together is used as the prediction model for age group and gender, where the output of the model represents the prediction of age group or gender. The prediction model is expressed as:
[0100]
[0101] represents the output of the XGBoost model, Γ is the regression tree space, represents the set of CART decision trees, and is defined as: Γ={f(x)=ω q(x)}(q:R m →T,ω∈R T );
[0102] Where f(x) represents a CART decision tree, which consists of a tree structure q and T leaf nodes. q represents the index of each tree structure mapped to the corresponding leaf node, x represents a user terminal, q(x) represents the leaf node where the user terminal is located, and each leaf node has a continuous value corresponding to it called the weight of the leaf node ω, ω q (x) is the output of the regression tree for the sample data, representing the value of each terminal user and used as the predicted value. k Corresponding to an independent tree structure q and its leaf node weight ω, all the weights constitute the weight vector ω∈R of the tree T .
[0103] The tree structure q maps any sample data with m-dimensional features to one of the leaf nodes through the feature attribute discrimination of the user terminal; each decision tree function f k Corresponding to a unique tree structure q and the corresponding leaf node weight vector ω; for a sample data, the XGBoos model obtains the final prediction value The process is: map the sample to the corresponding leaf node in each decision tree, and then add the weights of the k leaf nodes corresponding to the sample.
[0104] The XGboost objective function used by the XGboost algorithm is:
[0105]
[0106] Among them, the XGboost objective function is used to measure the deviation between the predicted value and the true value of the model. During the training process, the XGboost objective function is used to make the objective function value as small as possible; represents the predicted value, y i represents the target value; l represents the training objective function, which is used to measure the predicted value and the target value y iThe deviation between them is a regular term used to control the complexity of model training and is defined as: Ω represents the model complexity penalty term, γ and λ represent the penalty coefficients, and T represents the number of leaf nodes; ||ω|| 2 It represents the square of the output score of each tree leaf node, which is equivalent to L2 regularization. It can be seen that the penalty term in the XGboost model corresponds to the model complexity, taking into account the number of nodes in each tree and the sum of the squares of the output scores of each tree leaf node, and this penalty term is more convenient for parallel computing optimization.
[0107] To further illustrate, the feature matrix of the age group is input into the preset XGboost model, and the age group prediction model is obtained after training. Among them, when the age group prediction model is trained on the feature data of the marked age group, the age group is output. Among them, the output age group classification results include 6 types: 0-17 years old, 18-24 years old, 25-34 years old, 35-44 years old, 45-55 years old, and over 55 years old. The classification result is obtained through the probability value of the age group output by the model, that is, the output of which age group has the largest probability value, which indicates that the output is the corresponding age group type.
[0108] In this step, the gender feature matrix is trained by the XGboost algorithm, and a gender prediction model is obtained after training. When the gender prediction model is trained on the gender-labeled feature data, the gender type is output. When the probability value of the output gender type is greater than 0.4593821, it means that the output gender type is female, and when it is less than this value, it means that the gender type is male, and other outputs are unknown.
[0109] In this step, we further explain how to use the XGboost model to train and obtain the predicted value. The analysis is as follows:
[0110] The XGboost model is an efficient implementation of the Gradient Tree Boosting (GBDT), which can also be understood as a scalable machine learning system for boosting trees. In the XGboost model, a tree is generated by continuously splitting features, and a tree is learned in each round to fit the residual between the predicted value and the true value of the previous round of the model. When the training is completed and k trees are obtained, the score of a sample with prediction is predicted. According to the features of this sample with prediction, a corresponding leaf node will fall in each tree, and each leaf node corresponds to a score. Finally, the scores corresponding to each tree are added up to represent the predicted value of the sample.
[0111] To further illustrate: This embodiment assumes that multiple users of a family are multiple labeled data received, and the user terminal of each user constitutes a sample data set. The XGboost model is used to predict the degree of preference for electronic games in a family. It is considered that young people prefer electronic games more than old people; compared with women, men prefer electronic games more. Therefore, adults and children can be distinguished according to their age groups, and then gender is used to distinguish whether they are male or female, and each person's preference for electronic games is scored one by one.
[0112] The decision rules in the tree model are further used to classify the family members in the labeled user sample set, and tree models 1 and 2 are trained. The final prediction result is obtained by adding the scores on the corresponding leaf nodes. Therefore, the predicted score of the child is the sum of the scores of all nodes in the two tree models: 2+0.9=2.9. The predicted score of the adult is the same: -1+(-0.9)=-1.9. Therefore, the degree to which the child likes to play video games is 2.9, and the degree to which the elderly like to play video games is predicted to be -1.9, which means that the child likes to play video games more.
[0113] Further explanation The first term is used to control the number of leaf nodes in the tree model; the second term is used to control the weight distribution of leaf nodes; the two parameters γ and λ are used to adjust the ratio between the two parts in the regularization term.
[0114] According to the defined XGBoost objective function, the training sample set is used to train the XGBoost algorithm model; in the XGBoost algorithm, the training is carried out in the form of iterative addition of tree models, that is, at each step in the training process, a CART decision tree function is added to further reduce the loss function. The XGboost model is trained by cumulative sum, and further optimized by Taylor quadratic expansion, column downsampling, split search and other algorithms to improve the training speed and accuracy.
[0115] Furthermore, in this step, the list of applications installed on user terminals with marked age groups and genders is used as existing data for training to obtain an age group prediction model and a gender prediction model, respectively. Therefore, when obtaining relevant data, if the age and gender are unknown, the age group and gender can be predicted respectively based on the age group prediction model and the gender prediction model, providing a good foundation for accurate user portraits.
[0116] Step S5: Based on the age prediction model and the gender prediction model, the user's age group and gender are predicted for any application installed on the user terminal, and the user's age group and gender are obtained. At the same time, based on user characteristic attributes including region, city level, terminal type, and consumption level, multi-dimensional interest tags of the user are formed to construct a user portrait in order to make accurate recommendations to the user.
[0117] This step is based on the multi-dimensional or fusion construction of the portrait method, using data of multiple feature types to characterize the user from multiple dimensions. Furthermore, by further analyzing the predicted user age group and gender, combined with the user's region, city level, model, user behavior and other characteristics, such as consumption level, etc., a user portrait is generated, providing a good data foundation for precision marketing, personalized services, network public opinion management and many other aspects; and combined with the idea of the boosting tree algorithm, the age group and gender can be predicted, and its accuracy is improved, so that the user portrait can be generated more accurately.
[0118] Embodiment 2
[0119] refer to Figure 3 As shown, the embodiment of the present application provides a user portrait system based on predictable user feature attributes, and the method in the first embodiment is applied, including:
[0120] The database module 100 is configured to construct an Internet user terminal feature database, obtain the applications installed on each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes reported in each application, and then automatically merge them according to the tags to unify the categories;
[0121] The preprocessing module 200 is configured to obtain a number of sample data from the user feature database, and use age group features and gender features as labels to mark the sample data respectively;
[0122] The feature encoding module 300 is configured to perform one-hot encoding on the application list in the annotated data based on the age group feature to obtain an age group-based feature matrix; perform one-hot encoding on the application list in the annotated data based on the gender feature to obtain a gender-based feature matrix;
[0123] The model training module 400 is configured to input the feature matrix of the age group into a preset XGboost model, and obtain the age group prediction model after training, and input the feature matrix of the gender into a preset XGboost model, and obtain the gender prediction model after training;
[0124] The portrait generation module 500 is configured to predict the user's age group and gender for any application installed on the user terminal based on the age group prediction model and the gender prediction model, obtain the user's age group and gender, and at the same time, based on user characteristic attributes including region, city level, terminal type, and consumption level, form multi-dimensional interest tags for the user and generate a user portrait in order to make accurate recommendations to the user.
[0125] Embodiment 3
[0126] An embodiment of the present application provides an electronic device, comprising: one or more memories for storing executable program codes; a processor, connected to the memories, for storing one or more programs; and running a computer program corresponding to the executable program code by reading the executable program code to execute a user profiling method based on predictable user feature attributes as described in any one of the first embodiments.
[0127] An embodiment of the present application provides a storage medium storing executable program code, and at least one processor reads the executable program code to run a computer program corresponding to the executable program code to execute a user profiling method based on predictable user feature attributes as described in any one of the first embodiments.
[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0133] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A user profiling method based on predictable user feature attributes, the method comprising: S1: Build a feature database of Internet user terminals, obtain multiple applications installed on each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes including gender and age reported in each application, and then automatically merge them according to the predetermined labels to unify the categories; S2: Obtain some sample data from the user feature database, and use age group characteristics and gender characteristics as labels to mark the sample data respectively; S3: Based on the age group feature, one-hot encode the application list in the labeled data to obtain an age-based feature matrix; based on the gender feature, one-hot encode the application list in the labeled data to obtain a gender-based feature matrix; the age-based feature matrix and / or the gender-based feature matrix are used as feature inputs of the subsequent XGBoost algorithm, thereby forming a certain amount of sample data for predicting the characteristic attributes of the user terminal; S4: Use the XGBoost algorithm and improve its applicability to train the model using the acquired sample data; train the feature matrix of age group and the feature matrix of gender using the XGBoost algorithm, and obtain the prediction model of age group and gender after training; S5: Based on the age and gender prediction model, the user age and gender are predicted for any application installed on the user terminal, and the user age and gender are obtained. At the same time, based on the user's characteristic attributes including one or more of the region, city level, terminal type, and consumption level, multi-dimensional interest tags of the user are formed to construct and generate a user portrait, so as to make accurate recommendations to the user; In step S3, the method of obtaining the feature matrix based on age groups includes: S31: One-hot encode the application of each user terminal, encode the installed application as 1, and encode the uninstalled application as 0, and obtain the feature matrix (1) of the application installed by all user terminals in the labeled data: S32: Substitute the age group feature into the matrix (1) to obtain the feature matrix (2), which is expressed as follows: S33: Substitute the user attribute weights of each application based on the age group characteristics into the matrix (2) to obtain the age group-based feature matrix (3), which is expressed as follows: In step S3, the method for obtaining the gender-based feature matrix includes: S34: Substitute the gender feature into the matrix (1) to obtain the feature matrix (4), which is expressed as follows: S35: Substitute the gender-based user attribute weights of each application into the matrix (4) to obtain the gender-based feature matrix (5), which is expressed as follows:
2. The user profiling method based on predictable user feature attributes according to claim 1, characterized in that: In step S4, the method of training the feature matrix of age group and the feature matrix of gender by XGBoost algorithm to obtain the prediction model of age group and gender includes: S41: Receive a labeled sample data set, the sample data set includes n user terminals, each user terminal includes m feature data, and the sample data set is expressed as: D = {(x i ,y i )}(|D|=n,x i ∈R m ,y i ∈R); S42: Perform model training of the XGboost algorithm on the feature matrix of the age group and / or the feature matrix of the gender, train k trees in the XGboost algorithm, and finally obtain a CART decision tree consisting of k trees through the XGboost algorithm training: k (x) = ω q (x) The integrated model obtained by adding them together is used as the prediction model for age group and gender, where the output of the model represents the prediction of age group or gender. The prediction model is expressed as: represents the output of the XGBoost model, Γ is the regression tree space, and represents the set of CART decision trees, which is defined as: Γ={fx)=ω q(x) }(q:R m →T,ω∈R T ); Where f(x) represents a CART decision tree, which consists of a tree structure q and T leaf nodes. q represents the index of each tree structure mapped to the corresponding leaf node, x represents a user terminal, q(x) represents the leaf node where the user terminal is located, and each leaf node has a continuous value corresponding to it called the weight of the leaf node ω, ω q (x) is the output of the regression tree for the sample data, representing the value of each terminal user and used as the predicted value. k Corresponding to an independent tree structure q and its leaf node weight ω, all the weights constitute the weight vector ω∈R of the tree T ; The tree structure q maps any sample data with m-dimensional features to one of the leaf nodes through the feature attribute discrimination of the user terminal; each decision tree function f k Corresponding to a unique tree structure q and the corresponding leaf node weight vector ω; for a sample data, the XGBoos model obtains the final prediction value The process is: map the sample to the corresponding leaf node in each decision tree, and then add the weights of the k leaf nodes corresponding to the sample; The XGboost objective function used by the XGboost algorithm is: Among them, the XGboost objective function is used to measure the deviation between the predicted value and the true value of the model. During the training process, the XGboost objective function is used to make the objective function value as small as possible; Represents the predicted value, y i represents the target value; l represents the training objective function, which is used to measure the predicted value and the target value y i The deviation between is a regular term used to control the complexity of model training and is defined as: Ω represents the model complexity penalty term, γ and λ represent the penalty coefficients, and T represents the number of leaf nodes; ||ω|| 2 Represents the square of the output score of each tree leaf node, which is equivalent to L2 regularization.
3. The user profiling method based on predictable user feature attributes according to claim 1, characterized in that: Before step S3, the method also includes filtering out the top N applications with the largest number of applications based on the application list in the labeled data after receiving the labeled data, where N≥3000, and recording user terminals with 5 or more applications installed as user terminals that can implement one-hot encoding.
4. A system using the user profiling method based on predictable user feature attributes as described in any one of claims 1 to 3, characterized in that: include: A database module is configured to build a feature database of Internet user terminals, obtain the applications installed by each user terminal, assign different user attribute weights to different applications, and categorize the user feature attributes including gender and age reported in each application, and then automatically merge them according to the labels to unify the categories; A preprocessing module is configured to obtain a number of sample data from a user feature database, and use age group features and gender features as labels to mark the sample data respectively; A feature encoding module is configured to perform one-hot encoding on the application list in the labeled data based on the age group feature to obtain an age group-based feature matrix; Based on gender features, one-hot encoding is performed on the application list in the labeled data to obtain a gender-based feature matrix; the age-based feature matrix and / or the gender-based feature matrix are used as feature inputs for the subsequent XGBoost algorithm, thereby forming a certain amount of sample data for predicting characteristic attributes of user terminals; The model training module is configured to use the XGBoost algorithm and improve its applicability, and to train the model using the acquired sample data; the feature matrix of the age group and the feature matrix of the gender are input into the preset XGboost model, and the prediction model of the age group and the gender is obtained after training; The portrait generation module is configured to predict the user's age group and gender for any application installed on the user terminal based on the age group prediction model and the gender prediction model, obtain the user's age group and gender, and at the same time, based on user characteristic attributes including one or more of the region, city level, terminal type, and consumption level, form multi-dimensional interest tags for the user, and construct and generate a user portrait in order to make accurate recommendations to the user.
5. An electronic device, characterized in that: include: one or more memories for storing executable program code; a processor, connected to the memory, for storing one or more programs; The executable program code is read and a computer program corresponding to the executable program code is run to execute the user profiling method based on predictable user feature attributes as described in any one of claims 1 to 3.
6. A storage medium, characterized in that: An executable program code is stored, and at least one processor reads the executable program code to run a computer program corresponding to the executable program code to execute the user profiling method based on predictable user feature attributes as described in any one of claims 1-3.
