A feature selection method and device for generating user portraits
By using the policy network to filter features and dynamically adjusting the threshold in the user portrait feature selection, the problems of low accuracy and poor efficiency under the background of ultra-large-scale data in the existing technology are solved, efficient feature selection is achieved, and the training of user portrait model is improved Accuracy and efficiency.
Patent Information
- Application Number
- CN202010604427.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-29
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-06-29
AI Technical Summary
The existing user profile feature selection method has problems of low accuracy and poor efficiency in the context of hyper-large-scale data. The Filter method is sensitive to noise, while the Wrapper method has high time complexity and is not suitable for hyper-large-scale data mining tasks.
A feature selection method is adopted to receive the feature data to be processed, generate a set of candidate features, filter features based on preset evaluation model and correlation coefficient model, use a pre-trained policy network to perform feature screening, and dynamically adjust it during iterative training. Thresholds to improve feature selection efficiency and accuracy.
It improves the feature selection efficiency and accuracy of user portrait model training, avoids excessive memory calculation and disk storage usage, and enhances the accuracy and reliability of screening through a variety of correlation coefficient indicators.
Smart Images

Figure CN113743436B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a feature selection method and device for generating a user portrait. Background Art
[0002] User portraits are the key to marketing activities such as e-commerce, search, and news recommendations, as well as personalized recommendations and basic data services. The existing method for training portrait models is to train data models through machine learning, deep learning and other algorithms. In the model training process, we often face data with a large number of samples and high data feature dimensions. We can use feature selection to delete irrelevant and redundant feature information in the data, thereby reducing the data dimension, increasing computing time and space, avoiding overfitting, and improving model accuracy. The existing portrait model feature selection methods can be divided into two methods: filter and wrapper.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] The filter method is sensitive to noise and is often used for preliminary feature screening in practical applications. The wrapper method has the problem of high time complexity and is not suitable for ultra-large-scale data mining tasks. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a feature selection method and device for generating a user portrait, which can solve the problem that the existing user portrait feature selection method cannot meet the current ultra-large-scale data background and has low accuracy and poor efficiency.
[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a feature selection method for generating a user portrait is provided, comprising receiving feature data to be processed, generating a candidate feature set;
[0007] Calculate the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and record the features whose evaluation value is greater than a first threshold into the first candidate feature set; then calculate the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and record the features whose correlation coefficient is greater than a second threshold into the second candidate feature set;
[0008] The first threshold, the second threshold, the first candidate feature set and the second candidate feature set are substituted into the pre-trained policy network to obtain a feature set filtered by the policy for generating a user profile.
[0009] Optionally, before substituting the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained strategy network, the method includes:
[0010] Obtain historical feature data and its labels, and generate a candidate feature set based on the historical feature data;
[0011] In each round of iterative training of the policy network, an evaluation value of each feature in the candidate feature set is calculated based on a preset evaluation model, and features with evaluation values greater than a first threshold are recorded in the first candidate feature set; then, the correlation coefficient between every two features in the first candidate feature set is calculated based on a preset correlation coefficient model, and features with correlation coefficients greater than a second threshold are recorded in the second candidate feature set; a feature is randomly selected from the first candidate feature set and the feature in the first candidate feature set is deleted; the feature, the first threshold, the second threshold, the first candidate feature set, and the second candidate feature are substituted into the policy network to obtain the feature set screened by the iterative strategy for this round, so as to adjust the first threshold and the second threshold according to the number of features in the feature set screened by the iterative strategy for this round; and the feature set screened by the iterative strategy for this round is input into the classifier, and the loss function is calculated according to the classification results and the corresponding labels.
[0012] Optionally, a loss function is calculated based on the classification results and the corresponding labels, including:
[0013] The loss function of the model training adopts cross entropy, and then the obtained cross entropy is back-propagated to the policy network using BP.
[0014] Optionally, adjusting the first threshold and the second threshold according to the number of features in the feature set screened by the iteration strategy in this round includes:
[0015] It is determined whether the number of features in the feature set screened by the iteration strategy is greater than a preset number threshold. If so, the first threshold and the second threshold are reduced; otherwise, the first threshold and the second threshold are increased.
[0016] Optionally, it also includes:
[0017] The policy network adopts a random strategy to select actions.
[0018] Optionally, after obtaining the feature set screened by the iteration strategy of this round, the following steps are included:
[0019] Obtaining an action instruction returned by the policy network, if the action instruction is an add action instruction, continuing to randomly select a feature from the first candidate feature set and incorporate it into the candidate feature set, and deleting the feature in the first candidate feature set to perform iterative training of the policy network;
[0020] If the action instruction is a delete action instruction, then based on the preset correlation coefficient model, feature pairs with correlation coefficients between features greater than a preset coefficient threshold in the candidate feature set are obtained, one feature in the feature pair is randomly selected and incorporated into the first candidate feature set, and the feature in the alternative feature set is deleted to continue to execute the iterative training strategy network.
[0021] Optionally include:
[0022] Generate an evaluation model by one or more of information gain rate, Gini index and variance, wherein a first threshold of initialization of the evaluation model is an average value of evaluation values obtained for each feature based on the evaluation model;
[0023] A correlation coefficient model is generated by one or more of a Pearson correlation coefficient, a Spearman coefficient, mutual information and a distance correlation coefficient, wherein a second threshold for initializing the correlation coefficient model is an average value of correlation coefficients between every two features obtained based on the correlation coefficient model.
[0024] In addition, the present invention also provides a feature selection device for generating a user portrait, comprising a receiving module, for receiving feature data to be processed and generating a candidate feature set; a processing module, for calculating an evaluation value of each feature in the candidate feature set based on a preset evaluation model, and recording the features whose evaluation value is greater than a first threshold into a first candidate feature set; and then calculating the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and recording the features whose correlation coefficient is greater than a second threshold into a second candidate feature set; substituting the first threshold, the second threshold, the first candidate feature set and the second candidate feature set into a pre-trained strategy network to obtain a strategy-filtered feature set for generating a user portrait.
[0025] One embodiment of the above invention has the following advantages or beneficial effects: In order to improve the efficiency and accuracy of feature selection in user portrait model training, the present invention removes the Q table to avoid ultra-large memory calculation and disk storage occupation; and uses a variety of pearson correlation coefficients, spearman coefficients, mutual information, variance and distance correlation coefficients to increase action accuracy and reliability. When training data, multiple indicators are used for measurement (including: pearson, spearman, distance correlation coefficient, mutual information, Gini index, variance, information gain rate, etc.), and when screening features greater than a certain threshold, the mean is not roughly used as the threshold, but initialized to the mean, and then these values are added to the policy network for correction.
[0026] Among them, the user portrait is a series of data information (such as shopping information, personal information, etc.) contained in a successfully registered user ID on an e-commerce website. It is a virtual data collection. Q table is a table created to store the actions and states involved in the execution process, and calculate the maximum expected future reward for each action performed in each state. Action refers to an action that an agent will take in different states in the reinforcement learning algorithm. After the action is issued, different rewards can be received from the environment.
[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0029] Figure 1 is a schematic diagram of the main process of a feature selection method for generating a user portrait according to an embodiment of the present invention;
[0030] Figure 2 is an architecture diagram of a training strategy network according to an embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of main modules of a feature selection device for generating a user portrait according to an embodiment of the present invention;
[0032] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0033] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0035] Figure 1 FIG. 1 is a schematic diagram of the main process of a feature selection method for generating a user portrait according to an embodiment of the present invention. Figure 1 As shown, the feature selection method for generating a user portrait includes:
[0036] Step S101, receiving feature data to be processed and generating a candidate feature set.
[0037] In some embodiments, after receiving the feature data to be processed, the feature data to be processed can be preprocessed by a preset quality analysis model, and then a candidate feature set is generated. Preferably, the quality analysis model can include analysis of missing values, noise, outliers, data types, etc., and the analysis results can be combined to perform data cleaning (including missing value, noise and outlier processing, etc.), data encoding, and data deformation (including standardization, regularization, scaling, etc.).
[0038] Step S102, calculate the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and record the features whose evaluation value is greater than a first threshold into the first candidate feature set; then calculate the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and record the features whose correlation coefficient is greater than a second threshold into the second candidate feature set.
[0039] In some embodiments, the evaluation model is one or more of information gain rate, Gini index and variance, wherein the initialized first threshold corresponding to each evaluation model is the average value of the evaluation value of each feature based on the evaluation model, which can be subsequently added to the strategy network for training correction.
[0040] Among them, variance is a measure of the degree of dispersion when measuring a random variable or a set of data in probability theory and statistics.
[0041] The Gini index indicates the probability that a randomly selected sample in a sample set is misclassified.
[0042] Information gain is asymmetric in probability theory and information theory, and is used to measure the difference between two probability distributions P and Q. Information gain describes the difference when Q is used for encoding and then P is used for encoding. Usually P represents the distribution of samples or observations, or it may be a theoretical distribution that is precisely calculated.
[0043] The correlation coefficient model is one or more of the Pearson correlation coefficient, the Spearman coefficient, the mutual information and the distance correlation coefficient, wherein the initialization second threshold corresponding to each correlation coefficient model is the average value of the correlation coefficient between each two features based on the correlation coefficient model, which can be subsequently added to the strategy network for training correction.
[0044] Among them, mutual information is a useful information measure in information theory. It can be regarded as the amount of information contained in a random variable about another random variable, or the uncertainty of a random variable reduced by knowing another random variable.
[0045] The Pearson Correlation Coefficient is used to measure whether two data sets are on the same line. It is used to measure the linear relationship between interval variables.
[0046] The Spearman correlation coefficient is a nonparametric indicator for measuring the dependence of two variables. It uses a monotonic equation to evaluate the correlation between two statistical variables. If there are no repeated values in the data and when the two variables are completely monotonically correlated, the Spearman correlation coefficient is +1 or -1.
[0047] Distance correlation coefficients include cosine distance, Euclidean distance, and so on.
[0048] Step S103, substitute the first threshold, the second threshold, the first candidate feature set and the second candidate feature set into the pre-trained policy network to obtain a feature set screened by the policy for generating a user profile.
[0049] In an embodiment, the first candidate feature set and the second candidate feature set may form a state (i.e., a feature combination). The state and the first threshold and the second threshold are substituted into a pre-trained policy network to obtain a feature set filtered by the policy for generating a user profile.
[0050] In some embodiments, before substituting the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained policy network, the process includes:
[0051] Obtain historical feature data and its labels, and generate a candidate feature set based on the historical feature data;
[0052] In each round of iterative training of the policy network, an evaluation value of each feature in the candidate feature set is calculated based on a preset evaluation model, and features with evaluation values greater than a first threshold are recorded in the first candidate feature set; then, the correlation coefficient between every two features in the first candidate feature set is calculated based on a preset correlation coefficient model, and features with correlation coefficients greater than a second threshold are recorded in the second candidate feature set; a feature is randomly selected from the first candidate feature set and the feature in the first candidate feature set is deleted; the feature, the first threshold, the second threshold, the first candidate feature set, and the second candidate feature are substituted into the policy network to obtain the feature set screened by the iterative strategy for this round, so as to adjust the first threshold and the second threshold according to the number of features in the feature set screened by the iterative strategy for this round; and the feature set screened by the iterative strategy for this round is input into the classifier, and the loss function is calculated according to the classification results and the corresponding labels.
[0053] The iteration ends until the policy network converges or the first candidate feature set and the second candidate feature set are empty, and a trained policy network is obtained.
[0054] Preferably, the loss function of the model training adopts cross entropy, and the obtained cross entropy is back-propagated to the policy network using BP.
[0055] As some other embodiments of the present invention, adjusting the first threshold and the second threshold according to the number of features in the feature set screened by the iteration strategy in this round includes:
[0056] It is determined whether the number of features in the feature set screened by the iteration strategy is greater than a preset number threshold. If so, the first threshold and the second threshold are reduced; otherwise, the first threshold and the second threshold are increased.
[0057] Preferably, if the number of features in the feature set screened by the iterative strategy in this round is greater than a preset number threshold, the first threshold and the second threshold are reduced by a percentage; if the number of features in the feature set screened by the iterative strategy in this round is less than or equal to the preset number threshold, the first threshold and the second threshold are increased by a percentage.
[0058] That is to say, in the process of training the policy network, the first threshold and the second threshold can be adjusted after each round of iteration and brought into the next round of iteration for calculation, so that the policy network can achieve higher accuracy and realize dynamic adjustment of the first threshold and the second threshold.
[0059] It is worth noting that the strategy network adopts a random strategy to select actions. Preferably, after obtaining the feature set of this round of iterative strategy screening, it includes:
[0060] Obtaining an action instruction returned by the policy network, if the action instruction is an add action instruction, continuing to randomly select a feature from the first candidate feature set and incorporate it into the candidate feature set, and deleting the feature in the first candidate feature set to perform iterative training of the policy network;
[0061] If the action instruction is a delete action instruction, then based on the preset correlation coefficient model, feature pairs with correlation coefficients between features greater than a preset coefficient threshold in the candidate feature set are obtained, one feature in the feature pair is randomly selected and incorporated into the first candidate feature set, and the feature in the alternative feature set is deleted to continue to execute the iterative training strategy network.
[0062] It can be seen that in the process of training the policy network, after each round of iteration, the action instructions returned by the policy network can be used to dynamically adjust the features in the alternative feature set and the first candidate feature set, and then the next round of iterative calculations can be performed, which efficiently realizes the training of the policy network and obtains a policy network with extremely high accuracy.
[0063] In a specific embodiment of the present invention, the process of training the policy network takes the commonly used data set wine in the field of data mining as an example. This example is to identify wine varieties based on 13 characteristics of wine, with a total of 3 wine category labels, which belongs to a multi-classification task, and includes the following features:
[0064] 1) Alcohol content 2) Malic acid 3) Ash 4) Ash alkalinity 5) Magnesium 6) Total phenols 7) Flavonoids 8) Non-starch phenols 9) Proanthocyanidins 10) Color intensity 11) Hue 12) OD280 / OD315 of diluted wine 13) Proline
[0065] The input is the data set wine.data including the above 13 features, and the output is the optimal feature subset S (a subset of the 13 features). Figure 2 As shown, it is an architecture diagram of a training strategy network according to an embodiment of the present invention, including:
[0066] Step 1: Initialize the candidate feature set, that is, create an empty set T and a candidate feature set I = {f1, f2, ..., fD} (f1, f2, ..., fD: represents the 13 feature sets of the wine mentioned above).
[0067] Step 2: Calculate the information gain rate, Gini index, variance, etc. of each feature in the candidate feature set I according to the evaluation model, and then record the features above the first threshold into the first candidate feature set H. Each evaluation model corresponds to a corresponding initialization first threshold (for example, the first threshold n corresponding to the information gain rate, the first threshold m corresponding to the Gini index, and the first threshold p corresponding to the variance), which is the average value of the evaluation value obtained for each feature based on the evaluation model.
[0068] Step 3: Calculate the Pearson correlation coefficient, Spearman coefficient, mutual information and distance correlation coefficient between each two features in the first candidate feature set H according to the correlation coefficient model (for example, the correlation coefficient between alcohol content and malic acid, or between ash and magnesium), and record the features above the second threshold in each coefficient into the second candidate feature set P. The initialization second threshold corresponding to each correlation coefficient model is the average value of the correlation coefficients between each two features based on the correlation coefficient model. For example, the second threshold corresponding to the Pearson correlation coefficient is q.
[0069] Step 4: Randomly add a feature (such as alcohol content) fadd (fadd∈H), and assign the result of taking the union of T and feature fadd to T (i.e. T←T∪{fadd}), and then assign the result of deleting feature fadd from H to H (i.e. H←H\{fadd}).
[0070] Step 5: The fadd feature, the first threshold and the second threshold in step 2 and step 3, plus the first candidate feature set and the second candidate feature set currently selected are input into the policy network as the current state state. The policy network uses a random strategy to output action:
[0071] π(a t |s t ; θ) = σ(W*S t +b)
[0072] In the above formula, St is the current state, σ is sigmoid, π(a t |s t ; θ) is the probability of taking action, and then the features selected by this round of iterative strategy after the action is taken (action is indicated by 0 and 1, that is, whether to add or delete the action instruction) are input into the classifier to obtain the classification result. For example, at this time, only malic acid is left as the feature. The result accuracy of malic acid calculated by the classifier as a feature is a probability value between 0 and 1. This probability value is calculated with the label of the training set wine.data to obtain the reward value, which is the reward mentioned in step 8.
[0073] Step 6: Each round of iteration needs to correct the first threshold and the second threshold as the new threshold for the next round. Specifically, the correction method can be selected according to the performance of the current state, and it is determined whether the number of features in the feature set screened by the iteration strategy of this round is greater than the preset number threshold. If so, the first threshold and the second threshold are reduced by a percentage, otherwise the first threshold and the second threshold are increased by a percentage. For example: the current state result is 3 features, and more features need to be added to participate in the training. Then the first threshold and the second threshold can be set appropriately reduced by a percentage in the next round. In the next round, more features will be added to the policy network for training, otherwise, features will be added.
[0074] Step 7: Get the action instruction returned by the policy network. If the action instruction is an add action instruction, randomly select a feature fadd from the first candidate feature set H, T←T ∪{fadd}, H←H\{fadd}. If the action instruction is a delete action instruction, find several pairs of features with larger correlation coefficients between features in T (i.e., feature pairs with coefficients greater than a preset threshold) by querying P, and randomly select one feature fdel from the pairs of features, T←T\{fdel}, H←H∪{fdel}.
[0075] Step 8: Input the feature set selected by this round of iteration strategy (assuming that the feature set obtained after the screening in the above steps is: alcohol content and malic acid) into the classifier and calculate the reward (R). The reward is the probability obtained after the feature and label are calculated and then log transformed:
[0076] R = log P (y|x)
[0077] Here, y refers to the label data (in this case, the categories of various wines) and x refers to the candidate feature data (alcohol content and malic acid).
[0078] Step 9: Select cross entropy as the loss function for policy network training:
[0079]
[0080] In step eight, the loss function can be calculated by features and labels. Here, cross entropy is selected for calculation, and then the obtained cross entropy is back-propagated to the entire policy network using BP to correct the policy network parameters.
[0081] It is worth noting that if the entire cyclic calculation process (iterating from step 2 to step 8) reaches the termination condition (for example, there are no features in P and H or the policy network converges), the iteration is stopped. After N rounds of iteration, the policy network obtained is the best model.
[0082] Figure 3 is a schematic diagram of the main modules of the feature selection device for generating a user portrait according to an embodiment of the present invention, such as Figure 3 As shown, the feature selection device 300 for generating a user portrait includes a receiving module 301 and a processing module 302. The receiving module 301 receives the feature data to be processed and generates a candidate feature set; the processing module 302 calculates the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and records the features with the evaluation value greater than the first threshold into the first candidate feature set; then calculates the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and records the features with the correlation coefficient greater than the second threshold into the second candidate feature set; the first threshold, the second threshold, the first candidate feature set and the second candidate feature set are substituted into the pre-trained strategy network to obtain a strategy-screened feature set for generating a user portrait.
[0083] In some embodiments, before the processing module 302 substitutes the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained strategy network, the processing module 302 includes:
[0084] Obtain historical feature data and its labels, and generate a candidate feature set based on the historical feature data;
[0085] In each round of iterative training of the policy network, an evaluation value of each feature in the candidate feature set is calculated based on a preset evaluation model, and features with evaluation values greater than a first threshold are recorded in the first candidate feature set; then, the correlation coefficient between every two features in the first candidate feature set is calculated based on a preset correlation coefficient model, and features with correlation coefficients greater than a second threshold are recorded in the second candidate feature set; a feature is randomly selected from the first candidate feature set and the feature in the first candidate feature set is deleted; the feature, the first threshold, the second threshold, the first candidate feature set, and the second candidate feature are substituted into the policy network to obtain the feature set screened by the iterative strategy for this round, so as to adjust the first threshold and the second threshold according to the number of features in the feature set screened by the iterative strategy for this round; and the feature set screened by the iterative strategy for this round is input into the classifier, and the loss function is calculated according to the classification results and the corresponding labels.
[0086] In some embodiments, the processing module 302 calculates the loss function according to the classification result and the corresponding label, including:
[0087] The loss function of the model training adopts cross entropy, and then the obtained cross entropy is back-propagated to the policy network using BP.
[0088] In some embodiments, the processing module 302 adjusts the first threshold and the second threshold according to the number of features in the feature set screened by the iteration strategy, including:
[0089] It is determined whether the number of features in the feature set screened by the iteration strategy is greater than a preset number threshold. If so, the first threshold and the second threshold are reduced by a percentage; otherwise, the first threshold and the second threshold are increased by a percentage.
[0090] In some embodiments, the method further includes: the policy network adopts a random strategy to select actions.
[0091] In some embodiments, after the processing module 302 obtains the feature set screened by the iterative strategy, it includes:
[0092] Obtaining an action instruction returned by the policy network, if the action instruction is an add action instruction, continuing to randomly select a feature from the first candidate feature set and incorporate it into the candidate feature set, and deleting the feature in the first candidate feature set to perform iterative training of the policy network;
[0093] If the action instruction is a delete action instruction, then based on the preset correlation coefficient model, feature pairs with correlation coefficients between features greater than a preset coefficient threshold in the candidate feature set are obtained, one feature in the feature pair is randomly selected and incorporated into the first candidate feature set, and the feature in the alternative feature set is deleted to continue to execute the iterative training strategy network.
[0094] In some embodiments, the evaluation model is one or more of information gain rate, Gini index and variance, wherein the initialized first threshold corresponding to each evaluation model is the average value of the evaluation value obtained for each feature based on the evaluation model;
[0095] The correlation coefficient model is one or more of Pearson correlation coefficient, Spearman coefficient, mutual information and distance correlation coefficient, wherein the initialized second threshold corresponding to each correlation coefficient model is the average value of the correlation coefficients between every two features obtained based on the correlation coefficient model.
[0096] It should be noted that the feature selection method for generating a user portrait and the feature selection device for generating a user portrait described in the present invention have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.
[0097] Figure 4 An exemplary system architecture 400 is shown in which a feature selection method for generating a user portrait or a feature selection device for generating a user portrait, a feature selection discrimination for generating a user portrait or a feature selection discrimination device for generating a user portrait can be applied according to an embodiment of the present invention.
[0098] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0099] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0100] Terminal devices 401, 402, 403 can be various electronic devices that have a feature selection screen for generating a user portrait or a feature selection judgment screen for generating a user portrait and support web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.
[0101] Server 405 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using terminal devices 401, 402, and 403. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.
[0102] It should be noted that the feature selection method for generating a user portrait or the feature selection and discrimination method for generating a user portrait provided in the embodiments of the present invention is generally executed by the server 405 , and accordingly, the computing device is generally arranged in the server 405 .
[0103] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0104] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal 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.
[0105] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0106] The following components are connected to the I / O interface 505: an input section 806 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal feature selector (LCD) for generating a user portrait, etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0107] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include 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 the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0108] 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.
[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation 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 different order from the order 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 the 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.
[0110] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, it may be described as follows: a processor includes a receiving module and a processing module. The names of these modules do not, in some cases, limit the modules themselves.
[0111] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes receiving feature data to be processed and generating a candidate feature set; calculating the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and recording the features with the evaluation value greater than the first threshold into the first candidate feature set; then calculating the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and recording the features with the correlation coefficient greater than the second threshold into the second candidate feature set; substituting the first threshold, the second threshold, the first candidate feature set and the second candidate feature set into a pre-trained strategy network to obtain a strategy-screened feature set for generating a user portrait.
[0112] According to the technical solution of the embodiment of the present invention, it is possible to solve the problem that the existing user portrait feature selection method cannot meet the current ultra-large-scale data background and has low accuracy and poor efficiency.
[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A feature selection method for generating a user portrait, characterized in that: include: Receiving feature data to be processed and generating a candidate feature set; Calculate the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and record the features whose evaluation value is greater than a first threshold into the first candidate feature set; then calculate the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and record the features whose correlation coefficient is greater than a second threshold into the second candidate feature set; Substituting the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained policy network to obtain a feature set filtered by the policy for generating a user profile; Before substituting the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained policy network, the following steps are included: Obtain historical feature data and its labels, and generate a candidate feature set based on the historical feature data; In each round of iterative training of the policy network, an evaluation value of each feature in the candidate feature set is calculated based on a preset evaluation model, and features with evaluation values greater than a first threshold are recorded in the first candidate feature set; then, the correlation coefficient between every two features in the first candidate feature set is calculated based on a preset correlation coefficient model, and features with correlation coefficients greater than a second threshold are recorded in the second candidate feature set; a feature is randomly selected from the first candidate feature set and the feature in the first candidate feature set is deleted; the feature, the first threshold, the second threshold, the first candidate feature set, and the second candidate feature are substituted into the policy network to obtain the feature set selected by the iterative strategy for this round, so as to determine whether the number of features in the feature set selected by the iterative strategy for this round is greater than the preset number threshold, if so, the first threshold and the second threshold are reduced, otherwise, the first threshold and the second threshold are increased; and the feature set selected by the iterative strategy for this round is input into the classifier, and the loss function is calculated according to the classification result and the corresponding label.
2. The method according to claim 1, characterized in that The loss function is calculated based on the classification results and corresponding labels, including: The loss function of the model training adopts cross entropy, and then the obtained cross entropy is back-propagated to the policy network using BP.
3. The method according to claim 1, characterized in that Also includes: The policy network adopts a random strategy to select actions.
4. The method according to claim 3, characterized in that After obtaining the feature set screened by this round of iterative strategy, it includes: Obtaining an action instruction returned by the policy network, if the action instruction is an add action instruction, continuing to randomly select a feature from the first candidate feature set and incorporate it into the candidate feature set, and deleting the feature in the first candidate feature set to perform iterative training of the policy network; If the action instruction is a delete action instruction, then based on the preset correlation coefficient model, feature pairs with correlation coefficients between features greater than a preset coefficient threshold in the candidate feature set are obtained, one feature in the feature pair is randomly selected and incorporated into the first candidate feature set, and the feature in the alternative feature set is deleted to continue to execute the iterative training strategy network.
5. The method according to any one of claims 1 to 4, characterized in that: include: Generate an evaluation model by one or more of information gain rate, Gini index and variance, wherein a first threshold of initialization of the evaluation model is an average value of evaluation values obtained for each feature based on the evaluation model; A correlation coefficient model is generated by one or more of a Pearson correlation coefficient, a Spearman coefficient, mutual information and a distance correlation coefficient, wherein a second threshold for initializing the correlation coefficient model is an average value of correlation coefficients between every two features obtained based on the correlation coefficient model.
6. A feature selection device for generating a user portrait, characterized in that: include: A receiving module, used for receiving feature data to be processed and generating a candidate feature set; A processing module is used to calculate the evaluation value of each feature in the candidate feature set based on a preset evaluation model, and record the features whose evaluation values are greater than a first threshold value into a first candidate feature set; further calculate the correlation coefficient between every two features in the first candidate feature set based on a preset correlation coefficient model, and record the features whose correlation coefficients are greater than a second threshold value into a second candidate feature set; substitute the first threshold value, the second threshold value, the first candidate feature set, and the second candidate feature set into a pre-trained strategy network to obtain a feature set screened by the strategy for generating a user profile; Before the processing module 302 substitutes the first threshold, the second threshold, the first candidate feature set, and the second candidate feature set into the pre-trained strategy network, the processing module 302 includes: Obtain historical feature data and its labels, and generate a candidate feature set based on the historical feature data; In each round of iterative training of the policy network, an evaluation value of each feature in the candidate feature set is calculated based on a preset evaluation model, and features with evaluation values greater than a first threshold are recorded in the first candidate feature set; then, the correlation coefficient between every two features in the first candidate feature set is calculated based on a preset correlation coefficient model, and features with correlation coefficients greater than a second threshold are recorded in the second candidate feature set; a feature is randomly selected from the first candidate feature set and the feature in the first candidate feature set is deleted; the feature, the first threshold, the second threshold, the first candidate feature set, and the second candidate feature are substituted into the policy network to obtain the feature set selected by the iterative strategy for this round, so as to determine whether the number of features in the feature set selected by the iterative strategy for this round is greater than the preset number threshold, if so, the first threshold and the second threshold are reduced, otherwise, the first threshold and the second threshold are increased; and the feature set selected by the iterative strategy for this round is input into the classifier, and the loss function is calculated according to the classification result and the corresponding label.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
