User classification method, user classification device, storage medium, and electronic device
By dividing user data into positive and negative examples, determining the feature scores of feature variables, and filtering target feature variables, the problem of insufficient interpretability in multi-classification scenarios in existing technologies is solved, and efficient and accurate user classification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2026-04-10
AI Technical Summary
Existing user classification methods cannot guarantee interpretability in multi-class scenarios and are not applicable to the division of multiple categories.
By dividing user data into multiple data combinations including positive and negative examples, the feature scores of each feature variable are determined, and the target feature variables are selected. Then, a pre-trained classification model is used to classify users into multiple categories.
It enables the evaluation of the importance of feature variables in multi-classification scenarios, improves the accuracy and efficiency of user classification, and ensures the interpretability of the algorithm.
Smart Images

Figure CN113887669B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a user classification method, a user classification device, a computer readable storage medium and an electronic device. BACKGROUND
[0002] At present, for user type division in a binary classification scenario, users are mainly divided into two categories according to certain business standards, for example, when evaluating user credit, the information value of features can be calculated according to business standards, and users are divided into high credit users and low credit users.
[0003] However, as business scenarios continue to diversify and complicate, users often need to be divided into multiple categories. Although the existing information quantity calculation method has good interpretability, it cannot be applied to multi-classification business scenarios. Therefore, a user classification method capable of combining multi-classification and interpretability needs to be provided.
[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0005] The present disclosure provides a user classification method, a user classification device, a computer readable storage medium and an electronic device, thereby at least partially improving the problem that the prior art cannot balance the interpretability and multi-classification of the user classification method.
[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.
[0007] According to a first aspect of the present disclosure, a user classification method is provided, the method comprising: obtaining user data of a plurality of users, the user data comprising feature data of a plurality of feature variables and initial category labels of each of the users; dividing the user data into a plurality of data combinations comprising positive example data and negative example data according to the initial category labels; processing the positive example data and the negative example data in each data combination to determine feature scores of each of the feature variables; selecting a target feature variable from the plurality of feature variables according to the feature scores of each of the feature variables, and dividing the plurality of users into a plurality of categories through feature data corresponding to the target feature variable.
[0008] In an example embodiment of the present disclosure, the dividing the user data into a plurality of data combinations including positive example data and negative example data according to the initial category labels comprises: converting the user data into a plurality of first data combinations including positive example data and negative example data, with user data corresponding to at least one category label in the initial category labels as positive example data, and user data corresponding to other category labels except the at least one category label as negative example data; and converting the user data into a plurality of second data combinations including positive example data and negative example data, with user data corresponding to any one category label in the initial category labels as positive example data, and user data corresponding to any other category label except the any one category label as negative example data.
[0009] In an example embodiment of the present disclosure, the feature score includes an information amount of each feature variable, and the processing the positive example data and the negative example data in each data combination to determine the feature score of each feature variable comprises: for each data combination in the first data combinations and the second data combinations, determining the information amount of each feature variable in each data combination according to the number of positive example samples and the number of negative example samples in each data combination; summing the information amount of each feature variable in each data combination according to the combination category of each data combination to obtain a first feature information amount corresponding to the first data combinations and a second feature information amount corresponding to the second data combinations; and determining the information amount of each feature variable according to the first feature information amount and the second feature information amount.
[0010] In an example embodiment of the present disclosure, the determining the information amount of each feature variable in each data combination according to the number of positive example samples and the number of negative example samples in each data combination comprises: binning each feature variable and calculating an evidence weight of each bin variable corresponding to each feature variable; calculating a positive example sample rate and a negative example sample rate of each bin variable corresponding to each feature variable in each data combination, respectively; and weighting and summing a difference between the positive example sample rate and the negative example sample rate of each bin variable corresponding to each feature variable based on the evidence weight of each bin variable corresponding to each feature variable to obtain the information amount of each feature variable in each data combination.
[0011] In an example embodiment of the present disclosure, the determining the information amount of each feature variable according to the first feature information amount and the second feature information amount comprises: calculating the information amount of each feature variable with respect to each initial category label according to the first feature information amount and the second feature information amount; and summing the information amount of each feature variable with respect to each initial category label to obtain the information amount of each feature variable.
[0012] In an example implementation of the present disclosure, the screening of the target feature variable from the plurality of feature variables according to the feature score of each feature variable, and the division of the plurality of users into a plurality of categories through the feature data corresponding to the target feature variable, comprises: determining, in the feature score of each feature variable, a feature variable with a feature score greater than a feature score threshold as the target feature variable; extracting the feature data corresponding to the target feature variable to obtain target feature data, and performing classification processing on the target feature data through a pre-trained classification model to divide the plurality of users into a plurality of categories.
[0013] In an example implementation of the present disclosure, the classification processing of the target feature data through the pre-trained classification model to divide the plurality of users into a plurality of categories comprises: performing classification processing on the target feature data through a pre-trained logistic regression algorithm to divide the plurality of users into a plurality of categories.
[0014] According to a second aspect of the present disclosure, a user classification device is provided, which comprises: an acquisition module configured to acquire user data of a plurality of users, the user data comprising feature data of a plurality of feature variables and initial category labels of each user; a division module configured to divide the user data into a plurality of data combinations comprising positive example data and negative example data according to the initial category labels; a determination module configured to process the positive example data and the negative example data in each data combination to determine a feature score of each feature variable; and a classification module configured to screen a target feature variable from the plurality of feature variables according to the feature score of each feature variable, and divide the plurality of users into a plurality of categories through the feature data corresponding to the target feature variable.
[0015] In an example implementation of the present disclosure, the division module is configured to take the user data corresponding to at least one category label in the initial category labels as the positive example data, take the user data corresponding to other category labels except the at least one category label as the negative example data, convert the user data into a plurality of first data combinations comprising positive example data and negative example data, and take the user data corresponding to any one category label in the initial category labels as the positive example data, take the user data corresponding to any other category label except the any one category label as the negative example data, and convert the user data into a plurality of second data combinations comprising positive example data and negative example data.
[0016] In an example embodiment of the present disclosure, the feature score includes an information amount of each feature variable, and the determining module is configured to determine, for each of the first data combination and the second data combination, the information amount of each feature variable in each data combination according to a number of positive samples and a number of negative samples in each data combination, sum the information amount of each feature variable in each data combination according to a combination category of each data combination, obtain a first feature information amount corresponding to the first data combination and a second feature information amount corresponding to the second data combination, and determine the information amount of each feature variable according to the first feature information amount and the second feature information amount.
[0017] In an example embodiment of the present disclosure, the determining module is configured to bin each feature variable and calculate an evidence weight of each bin variable corresponding to each feature variable, calculate a positive sample rate and a negative sample rate of each bin variable corresponding to each feature variable in each data combination, and perform weighted summation on a difference between the positive sample rate and the negative sample rate of each bin variable corresponding to each feature variable based on the evidence weight of each bin variable corresponding to each feature variable, to obtain the information amount of each feature variable in each data combination.
[0018] In an example embodiment of the present disclosure, the determining module is further configured to calculate an information amount of each feature variable with respect to each initial category label according to the first feature information amount and the second feature information amount, and sum the information amount of each feature variable with respect to each initial category label to obtain the information amount of each feature variable.
[0019] In an example embodiment of the present disclosure, the classification module is configured to determine, in the feature score of each feature variable, a feature variable with a feature score greater than a feature score threshold as a target feature variable, extract feature data corresponding to the target feature variable to obtain target feature data, and perform classification processing on the target feature data by using a pre-trained classification model to divide the plurality of users into a plurality of categories.
[0020] In an example embodiment of the present disclosure, the classification module is further configured to perform classification processing on the target feature data by using a pre-trained logistic regression algorithm to divide the plurality of users into a plurality of categories.
[0021] According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement any of the above user classification methods.
[0022] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the above user classification methods via execution of the executable instructions.
[0023] The present disclosure has the following beneficial effects:
[0024] In summary, according to the user classification method, the user classification device, the computer readable storage medium and the electronic device in the present exemplary embodiment, the user data can be divided into a plurality of data combinations including positive example data and negative example data according to initial class labels, and the positive example data and the negative example data in each data combination are processed to determine the feature scores of each feature variable in the user data, to filter out target feature variables from the plurality of feature variables according to the feature scores of each feature variable, and to divide a plurality of users into a plurality of categories through the feature data corresponding to the target feature variables. On the one hand, by dividing the user data into a plurality of data combinations including positive example data and negative example data, and determining the feature scores of each feature variable in the user data, the multi-classification problem can be converted into a binary classification problem, the information quantity of each feature variable in a multi-classification scenario is calculated according to the information quantity of each feature variable in a binary classification scenario, and the evaluation of the importance of the feature variables is realized on the basis of ensuring the interpretability of the algorithm. On the other hand, by filtering out target feature variables from the plurality of feature variables according to the feature scores of each feature variable, and dividing a plurality of users into a plurality of categories through the feature data corresponding to the target feature variables, the feature selection in a multi-classification scenario based on a binary classification method is realized, and the accuracy and efficiency of user classification are improved.
[0025] It should be understood that the general description above and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0026] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0027] Figure 1 A flowchart of a user classification method in the present exemplary embodiment is shown;
[0028] Figure 2 A flowchart of dividing data combinations in the present exemplary embodiment is shown;
[0029] Figure 3A flow chart illustrating a method of calculating the amount of feature information in the present exemplary embodiment is shown.
[0030] Figure 4 A sub-flow chart illustrating a method of calculating the amount of feature information in the present exemplary embodiment is shown.
[0031] Figure 5 A flow chart illustrating another method of calculating the amount of feature information in the present exemplary embodiment is shown.
[0032] Figure 6 A flow chart illustrating a method of determining the user category in the present exemplary embodiment is shown.
[0033] Figure 7 A structural block diagram of a user categorization apparatus in the present exemplary embodiment is shown.
[0034] Figure 8 A computer readable storage medium for implementing the above method in the present exemplary embodiment is shown.
[0035] Figure 9 An electronic device for implementing the above method in the present exemplary embodiment is shown. DETAILED DESCRIPTION
[0036] Example embodiments now will be described more fully hereinafter with reference to the accompanying drawings. Example embodiments, however, can be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example embodiments to those skilled in the art. Features, structures or characteristics described in conjunction with the described examples can be combined in any suitable manner in one or more embodiments.
[0037] The exemplary embodiments of the present disclosure first provide a user categorization method, which can divide users into multiple categories by processing the obtained user data. For example, in a shopping application, users can be divided into key users, general users, potential users, etc. according to the obtained user data, so that the application can push matching goods, etc. to users according to the user category.
[0038] Figure 1 A flow of the present exemplary embodiment is shown, which can include the following steps S110-S140:
[0039] Step S110. Obtain user data of multiple users.
[0040] The user data can include feature data of a plurality of feature variables and initial category labels of each user. Specifically, the user data can include basic data of the user and behavior data of the user in a period of time, wherein the basic data can include age, gender, address, interest, etc. of the user, and the behavior data can be data collected by the user when using the application program, for example, in a communication application, the behavior data can be payment data, call data, traffic data, etc. generated by the user in a period of time, and in an e-commerce application, the behavior data can be record data when the user generates purchase, browsing, attention, etc. to goods. The feature variable refers to a property variable that affects the classification category of the user, for example, when evaluating the credit of the user, the feature variable can include payment, points data, online time, etc. of the user, and the feature data refers to the specific data content of the feature variable. The initial category label of the user can be an initial category of the user set according to a certain business standard, such as the monthly payment amount of the user, and generally includes two or more category labels.
[0041] When obtaining the user data, the operator can take any one or more of the username, time, region, etc. as an index to obtain the corresponding user data in a specific database or data platform, or in order to timely monitor the category change of the user, a certain time interval can be set to automatically extract the user data in the corresponding time period from the database or data platform.
[0042] Step S120. Dividing the user data into a plurality of data combinations including positive example data and negative example data according to the initial category label.
[0043] The positive example data and the negative example data are category data set according to the prediction target, the positive example data refers to the user data predicted as a positive example category, and the negative example data refers to the user data predicted as a negative example category.
[0044] After obtaining the user data, the user data can be divided into a plurality of data combinations according to the initial category label, each data combination includes positive example data and negative example data, thereby the multi-classification problem can be converted into a binary classification problem, and the interpretability of the user data is improved.
[0045] Specifically, in an optional embodiment, referring to Figure 2 As shown in the figure, step S120 can be implemented through steps S210-S220 as follows:
[0046] Step S210. Taking the user data corresponding to at least one category label in the initial category label as positive example data, and taking the user data corresponding to other category labels except the at least one category label as negative example data, and converting the user data into a plurality of first data combinations including positive example data and negative example data.
[0047] For example, the user data corresponding to each of the initial category labels can be respectively taken as positive example data, and the user data corresponding to the remaining category labels can be taken as negative example data, the category labels in the initial category labels are traversed and combined, and the user data is converted into a plurality of first data combinations including positive example data and negative example data. Table 1 below shows an example of dividing positive example categories and negative example categories as follows:
[0048] Table 1
[0049]
[0050]
[0051] wherein n represents the number of category labels in the initial category labels, label k represents that the kthcategory label is taken as a positive example category, and other k (label1,…label k-1 ,label k+1 ,…label n ) represents that the other category labels except the kthcategory label are taken as negative example categories, and each positive example category and its corresponding negative example category constitute a binary classification data combination.
[0052] In step S220, the user data corresponding to any one of the category labels in the initial category labels is taken as positive example data, and the user data corresponding to any one of the other category labels except the above-mentioned any one of the category labels is taken as negative example data, and the user data is converted into a plurality of second data combinations including positive example data and negative example data.
[0053] For example, the user data corresponding to any two of the category labels in the initial category labels can be respectively taken as positive example data and negative example data, the category labels in the initial category labels are traversed and combined, and the user data is converted into a plurality of second data combinations including positive example data and negative example data. For another example, each of the category labels can be taken as a positive example category according to the order of the category labels in the initial category labels, each of the category labels after the category label in the order can be taken as a negative example category, the user data corresponding to the positive example category and the negative example category can be respectively taken as positive example data and negative example data, and each of the second data combinations is obtained. Table 2 below shows another example of dividing positive example categories and negative example categories as follows:
[0054] Table 1
[0055] Positive class Negative class Information value of feature f <label2> IV f,1,2 ]] IV f,1,3 ]] … … … label n ]]> IV f,1,n ]] … … … label k ]]> label k+1 ]]> IV f,k,k+1 ]] … … … label k ]]> label n ]]> IV f,k,n ]] … … … label n-1 ]]> label n ]]> IV f,n-1,n ]]
[0056] wherein n represents the number of category labels in the initial category labels, label k represents that the kthcategory label is taken as a positive example category, and otherk+1 indicates that the k+1th category label is a negative example category. For each positive example category, such as the kth positive example category, the negative example category can select the k+1th, k+2th,..., nth category label, thus, one positive example category can correspond to n-k negative example categories, that is, the positive example category and the negative example category can form n-k binary classification combinations.
[0057] In fact, through the above steps S210-S220, the user data can be converted into the first data combination and the second data combination with only two categories of data through the one vs rest strategy and the one vs one strategy respectively, and the conversion from the multi-classification problem to the binary classification problem is realized.
[0058] Step S130. Process the positive example data and the negative example data in each data combination to determine the feature scores of the feature variables.
[0059] The feature score is a score of the prediction ability of the feature variable for judging the user category, and the higher the feature score, the stronger the prediction ability of the feature variable for the user category, and the higher the prediction contribution.
[0060] After the user data is divided into a plurality of data combinations including positive example data and negative example data, the correlation between the feature variables and the classification results in the positive example data and the negative example data can be calculated to determine the feature scores of the feature variables. For example, for the positive example data and the negative example data, the mutual information between the feature variables and the positive example category and the mutual information between the feature variables and the negative example category can be calculated respectively to determine the influence of the occurrence of each feature variable on the classification result and to determine the feature scores of the feature variables.
[0061] In practical applications, the feature score can be any index data for evaluating the prediction ability of the feature variable. For example, in an optional implementation, the feature score can be the information amount of the feature variable. The information amount is a measure of information value, and in a classification problem, the information amount is a measure of the prediction ability of the variable for judging the category. The more the information amount of the feature variable, the stronger the prediction ability of the feature variable.
[0062] Further, when the user data is divided into the first data combination, since the rules between the data of different categories are different, dividing the user data originally belonging to different categories into the same category will cause information conflict between the user data of different categories, that is, data rule conflict between the feature variables, and will cause information loss. Therefore, under this condition, the feature scores of the feature variables can be determined by calculating the information amount of each feature variable in each data combination. Specifically, as shown in FIG. 3, the following steps S310-S330 can be implemented: Figure 3 Further, when the user data is divided into the first data combination, since the rules between the data of different categories are different, dividing the user data originally belonging to different categories into the same category will cause information conflict between the user data of different categories, that is, data rule conflict between the feature variables, and will cause information loss. Therefore, under this condition, the feature scores of the feature variables can be determined by calculating the information amount of each feature variable in each data combination. Specifically, as shown in FIG. 3, the following steps S310-S330 can be implemented:
[0063] Step S310, for each data combination in the first data combination and the second data combination, the information quantity of each feature variable in each data combination is determined according to the number of positive example samples and the number of negative example samples in each data combination.
[0064] For each data combination in the first data combination and the second data combination, the information quantity of each feature variable in each data combination can be determined by the information quantity of each feature variable in the positive example category and the negative example category in each data combination. In a specific implementation, each feature variable can be divided into a plurality of data intervals, the number of positive example samples and the number of negative example samples corresponding to each data interval are counted, and the information quantity of each feature variable in each data combination is calculated.
[0065] In an optional embodiment, referring to FIG. 4, the following steps S410-S420 can be performed to determine the information quantity of each feature variable in each data combination: Figure 4
[0066] Step S410, binning is performed on each feature variable, and the weight of evidence of each bin variable corresponding to each feature variable is calculated.
[0067] Binning is a data preprocessing technique, through which continuous variables can be discretized, the risk of overfitting of a model can be avoided, and the model is more stable. The weight of evidence (WOE) is a method for measuring the distribution difference between positive example samples and negative example samples.
[0068] In the example embodiment, supervised binning, chi-square binning and the like can be used to bin each feature variable, and then the weight of evidence of each bin variable corresponding to each feature variable is calculated. For example, the weight of evidence of the i th bin of the feature variable f can be calculated by using the following formula (1):
[0069]
[0070] where y i,正 represents the number of positive example samples in the i th bin, y T,正 represents the number of all positive example samples in the corresponding data group, y i,负 represents the number of negative example samples in the i th bin, y T,负 represents the number of all negative example samples in the corresponding data group.
[0071] Step S420, in each data combination, the positive example sample rate and the negative example sample rate of each bin variable corresponding to each feature variable are calculated respectively.
[0072] In each data combination, the positive example sample rate and the negative example sample rate of each bin variable corresponding to each feature variable are yi,正 / y T,正 and y i,负 / y T,负 .
[0073] In step S430, the difference between the positive example sample rate and the negative example sample rate of each binned variable corresponding to each feature variable is weighted and summed based on the evidence weight of each binned variable corresponding to each feature variable, to obtain the information quantity of each feature variable in each data combination.
[0074] According to the evidence weight of each binned variable corresponding to each feature variable, the difference between the positive example sample rate and the negative example sample rate of the corresponding binned variable is weighted, and then the difference between the weighted positive example sample rate and the negative example sample rate of each binned variable is summed, to obtain the information quantity of the corresponding feature variable in the corresponding data combination. Specifically, the weighted value IV of the i-th binned variable can be calculated by the following formulas (2) and (3): i and the information quantity IV of the feature variable in the data combination:
[0075]
[0076]
[0077] wherein m represents the number of bins of a certain feature variable.
[0078] Through the above method, the information quantity of each feature variable can be calculated to determine the influence of each feature variable on the positive example category and the negative example category. Meanwhile, by binning each feature variable and calculating the information quantity of each feature variable, the algorithm model can be simplified and the stability of the algorithm model can be improved.
[0079] In step S320, the information quantity of each feature variable in each data combination is summed according to the combination category of each data combination, to obtain the first feature information quantity corresponding to the first data combination and the second feature information quantity corresponding to the second data combination.
[0080] wherein the combination category of the data combination refers to whether the corresponding data combination belongs to the first data combination or the second data combination. The feature information quantity can include the information quantity of each feature variable in each corresponding data combination. For example, the first feature information quantity can include the information quantity of each feature variable in each data combination of the first data combination.
[0081] According to the combination category of each data combination, each first data combination and each second data combination can be determined, and then the information quantity of each feature variable in each first data combination is summed to obtain the information quantity of each feature variable in the first data combination, i.e. the first feature information quantity. For example, in the positive example category and the negative example category shown in Table 1, the information quantity of the feature variable f in the first data combination is the sum of the information quantity of the feature variable f in each data combination of the first data combination.k and the positive example category corresponding to the negative example category other k The information quantity in the first data combination composed of represents the information quantity of the feature variable f for judging the label k , other k The prediction ability of the binary combination composed of The information quantity in the second data combination composed of k and the positive example category corresponding to the negative example category label k+1 The information quantity in the second data combination composed of f,k,k+1 represents the information quantity of the feature variable f for judging the label k , label k+1 The prediction ability of the binary combination composed of
[0082] As mentioned above, in the calculation of the first feature information quantity and the second feature information quantity, since the data belonging to different category labels are marked as negative example categories, a large amount of information conflicts will be generated in the negative example data, resulting in information loss. Therefore, for the first data combination and the second data combination, the information quantity of each feature variable in the negative example data in each data combination can be calculated, and then the information quantity of each feature variable in each data combination can be calculated. For example, for each first data combination, the first feature information quantity of the feature variable f in the negative example data corresponding to the kth category as the positive example category can be calculated by the following formula (4):
[0083]
[0084] wherein, represents the information quantity of the feature variable f for judging other categories except the kth category, represents the information quantity of the feature variable f for judging the nth category, is an information loss coefficient, which can be set to 0.5, etc., and n represents the number of category labels of the initial category label.
[0085] It can be seen from the above formula (4) that the more the number of other categories represented by other k , the more the information quantity lost after being uniformly marked as negative example categories. Furthermore, the information quantity of each feature variable in each data combination can include the information quantity of each feature variable in the positive example data and the negative example data of each data combination. Therefore, for the feature variable f, the first feature information quantity of the feature variable f in the kth first data combination can be calculated by the following formula (5):
[0086]
[0087] For each second data combination, the information quantity of the feature variable in the positive example data and the information quantity in the negative example data of each second data combination can be calculated one by one, for example, by the following formula (6)
[0088]
[0089] wherein IV f,k,n represents the information quantity of the feature variable f in the positive example class label k and the negative example class label n in the corresponding data combination.
[0090] In step S330, the information quantity of each feature variable is determined according to the first feature information quantity and the second feature information quantity.
[0091] After obtaining the first feature information quantity and the second feature information quantity, the information quantity of each feature variable can be obtained by aggregating the information quantity of each feature variable. For example, the first feature information quantity and the second feature information quantity corresponding to the feature variable f can be aggregated to obtain the information quantity of the feature variable f.
[0092] Specifically, in an optional embodiment, referring to Figure 5 the information quantity of each feature variable can be determined by the following steps S510-S520:
[0093] In step S510, the information quantity of each feature variable with respect to each initial class label is calculated according to the first feature information quantity and the second feature information quantity.
[0094] For example, in combination with formula (5) and formula (6), the following formula (7) can be obtained:
[0095]
[0096] In combination with (5) and (7), the information quantity of the feature variable f in judging the kth class label can be obtained:
[0097]
[0098] In step S520, the information quantity of each feature variable with respect to each initial class label is summed to obtain the information quantity of each feature variable.
[0099] For example, for the feature variable f, the information quantity of the feature variable f in judging each class label can be summed by the following formula (9) to obtain the information quantity of the feature variable f in predicting the user class, that is, the prediction ability of the feature variable f for the user class:
[0100]
[0101] wherein IV f,k,i represents the prediction ability of the feature variable f for the binary data combination composed of the kth class label and the ith class label, otherk represents marking the remaining class labels other than the kth class label as negative example class labels, represents the prediction ability of the feature variable f for the binary data combination composed of the label k , and other k .
[0102] By the above method, the information amount of each feature variable can be determined by using the two kinds of binary data combinations generated according to the one vs rest strategy and the one vs one strategy, and the feature importance evaluation in the multi-classification scenario based on binary classification is realized.
[0103] Step S140. According to the feature scores of the feature variables, a target feature variable is selected from the plurality of feature variables, and the plurality of users are divided into a plurality of categories by the feature data corresponding to the target feature variable.
[0104] The target feature variable refers to a feature variable that has a high influence on the classification result of the user. After determining the feature scores of the feature variables, the target feature variable can be selected from the plurality of feature variables according to the high and low of the feature scores, and then the plurality of users are divided into a plurality of categories by the feature data corresponding to the target feature variable in the user data.
[0105] Specifically, in an optional implementation, the step S140 can also be implemented by the method as shown in the following table: Figure 6
[0106] Step S610. In the feature scores of the feature variables, the feature variable with a feature score greater than a feature score threshold is determined as a target feature variable.
[0107] The feature score threshold can be set by the experience of the operator, etc., such as 0.1, etc.
[0108] When selecting the target feature variable, the feature scores of the feature variables can also be sorted in descending order, and the first N are selected as the target feature variable, N being a positive integer.
[0109] Step S620. The feature data corresponding to the target feature variable is extracted to obtain target feature data, and the target feature data is classified by the pre-trained classification model to divide the plurality of users into a plurality of categories.
[0110] After the target feature variable is determined, the target feature data corresponding to the target feature variable can be extracted from the user data by taking the variable name of the target feature variable as an index, and then the target feature data is trained by a pre-trained classification model to obtain the category of each user. The classification model can be a model composed of any one or more classification algorithms, and can include a neural network algorithm, an XGBoost algorithm (a kind of classification algorithm), and an SVM (Support Vector Machines) algorithm, etc.
[0111] By determining the target feature variable in each feature variable, a variable with high influence on the user category can be screened out from the feature variables, the influence of weak-influence feature variables on user classification is reduced, the data amount of input data is reduced, and the efficiency of determining the user category is improved.
[0112] In an optional embodiment, the target feature data can be classified by using a pre-trained logistic regression algorithm, and a plurality of users can be divided into a plurality of categories. For example, one of the plurality of users can be selected as a positive class, and all other classes can be classified as negative classes for binary classification training to obtain a plurality of binary classifiers. Then, during prediction, each classifier can obtain the probability of the current positive class according to the target feature data, and the maximum probability value in each classifier can be determined as the final classification result of the corresponding user. By this method, the whole process of user data processing can be realized by the binary classification idea, and the algorithm interpretability is taken into account on the basis of realizing user multi-classification.
[0113] In addition, the user classification method in the present exemplary embodiment can be encapsulated as an independent computing unit by using Java language and a distributed computing framework, and the computing unit can be managed by containerization to ensure that the operation data and resources of the operator are independent of each other.
[0114] In summary, according to the user classification method in the example embodiment, the user data can be divided into a plurality of data combinations including positive example data and negative example data according to the initial class labels, and the positive example data and the negative example data in each data combination are processed to determine the feature scores of each feature variable in the user data, the target feature variable is selected from the plurality of feature variables according to the feature scores of each feature variable, and the plurality of users are divided into a plurality of categories through the feature data corresponding to the target feature variable. On the one hand, by dividing the user data into a plurality of data combinations including positive example data and negative example data, and determining the feature scores of each feature variable in the user data, the multi-classification problem can be converted into a binary classification problem, the information amount of each feature variable in the multi-classification scene is calculated according to the information amount of each feature variable in the binary classification scene, and the evaluation of the importance of the feature variable is realized on the basis of ensuring the interpretability of the algorithm. On the other hand, by selecting the target feature variable from the plurality of feature variables according to the feature scores of each feature variable, and dividing the plurality of users into a plurality of categories through the feature data corresponding to the target feature variable, the feature selection in the multi-classification scene based on the binary classification method is realized, and the accuracy and efficiency of user classification are improved.
[0115] Further, the example embodiment also provides a user classification device, as shown in Figure 7 The user classification device can include an acquisition module 710, which can be used to acquire user data of a plurality of users, the user data can include feature data of a plurality of feature variables and initial class labels of each user; a division module 720, which can be used to divide the user data into a plurality of data combinations that can include positive example data and negative example data according to the initial class labels; a determination module 730, which can be used to process the positive example data and the negative example data in each data combination to determine the feature scores of each feature variable; and a classification module 740, which can be used to select a target feature variable from the plurality of feature variables according to the feature scores of each feature variable, and divide the plurality of users into a plurality of categories through the feature data corresponding to the target feature variable.
[0116] In an example embodiment of the present disclosure, the division module 720 can be used to convert the user data into a plurality of first data combinations that can include positive example data and negative example data, by taking the user data corresponding to at least one class label in the initial class labels as the positive example data, and taking the user data corresponding to other class labels except the at least one class label as the negative example data, and convert the user data into a plurality of second data combinations that can include positive example data and negative example data, by taking the user data corresponding to any one class label in the initial class labels as the positive example data, and taking the user data corresponding to any one class label except the any one class label as the negative example data.
[0117] In an example embodiment of the present disclosure, the feature score can include the information quantity of each feature variable, and the determining module 730 can be configured to determine, for each of the first data combination and the second data combination, the information quantity of each feature variable in each data combination according to the number of positive example samples and the number of negative example samples in each data combination, sum the information quantity of each feature variable in each data combination according to the combination category of each data combination, obtain the first feature information quantity corresponding to the first data combination and the second feature information quantity corresponding to the second data combination, and determine the information quantity of each feature variable according to the first feature information quantity and the second feature information quantity.
[0118] In an example embodiment of the present disclosure, the determining module 730 can be configured to bin each feature variable and calculate the evidence weight of each bin variable corresponding to each feature variable, calculate the positive example sample rate and the negative example sample rate of each bin variable corresponding to each feature variable in each data combination, and perform weighted summation on the difference between the positive example sample rate and the negative example sample rate of each bin variable corresponding to each feature variable based on the evidence weight of each bin variable corresponding to each feature variable, to obtain the information quantity of each feature variable in each data combination.
[0119] In an example embodiment of the present disclosure, the determining module 730 can be further configured to calculate the information quantity of each feature variable with respect to each initial category label according to the first feature information quantity and the second feature information quantity, and sum the information quantity of each feature variable with respect to each initial category label to obtain the information quantity of each feature variable.
[0120] In an example embodiment of the present disclosure, the classification module 740 can be configured to determine, in the feature score of each feature variable, a feature variable with a feature score greater than a feature score threshold as a target feature variable, extract feature data corresponding to the target feature variable to obtain target feature data, and perform classification processing on the target feature data by using a pre-trained classification model to divide a plurality of users into a plurality of categories.
[0121] In an example embodiment of the present disclosure, the classification module 740 can be further configured to perform classification processing on the target feature data by using a pre-trained logistic regression algorithm to divide a plurality of users into a plurality of categories.
[0122] The specific details of each module in the above apparatus have been described in detail in the method embodiments, and the undisclosed scheme details can be referred to the embodiment contents of the method part, and thus will not be described again.
[0123] Those skilled in the art can understand that various aspects of the present disclosure can be implemented as a system, a method or a program product. Therefore, various aspects of the present disclosure can be embodied in a form of entirely hardware, entirely software (including firmware, microcode, etc.), or a combination of hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" herein.
[0124] The exemplary embodiments of the present disclosure also provide a computer readable storage medium having stored thereon a program product capable of implementing the above-described method of the present disclosure. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing an end device to perform the steps described in the above "Exemplary Method" section according to various exemplary embodiments of the present disclosure when the program product is run on the end device.
[0125] Reference Figure 8 As shown, the program product 800 for implementing the above-described method according to the exemplary embodiments of the present disclosure is described, which can adopt a portable compact disc read-only memory (CD-ROM) and include program codes, and can be run on an end device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in the present document, the readable storage medium can be any tangible medium containing or storing a program, which can be used or combined with an instruction execution system, device or apparatus.
[0126] The program product 800 can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium, for example, can be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disc, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0127] The computer readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which readable program codes are borne. Such a propagated data signal can take on multiple forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable signal medium can also be any readable medium that is not a readable storage medium, which can send, propagate or transmit the program for use by or in connection with an instruction execution system, device or apparatus.
[0128] The program code embodied on the computer readable medium can be transmitted by any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, and the like, or any suitable combination of the foregoing.
[0129] The program code, when executed, can perform a method of the present disclosure. The program code can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The present disclosure relates to any combination of the features recited above.
[0130] An exemplary embodiment of the present disclosure further provides an electronic device capable of implementing the above method. The electronic device 900 according to this exemplary embodiment of the present disclosure will be described below with reference to Figure 9 Figure 9 The electronic device 900 shown is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
[0131] As shown in Figure 9 , the electronic device 900 can be in the form of a general computing device. The components of the electronic device 900 can include, but are not limited to, the at least one processing unit 910 described above, the at least one storage unit 920 described above, a bus 930 connecting different system components, including the storage unit 920 and the processing unit 910, and a display unit 940.
[0132] The storage unit 920 stores program code that can be executed by the processing unit 910, so that the processing unit 910 performs the steps described above according to various exemplary embodiments of the present disclosure in the "Exemplary Method" section of the present specification. For example, the processing unit 910 can perform the method steps shown in Figures 1 to 6 and the like.
[0133] The storage unit 920 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 921 and / or a cache memory unit 922, and can further include a read-only memory (ROM) 923.
[0134] The storage unit 920 can also include a program / utility 924 having a set (at least one) of program modules 925, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which can include implementation of a network environment, alone or in combination.
[0135] The bus 930 can represent one or more of several types of bus structures, including a storage unit bus or bus for storage unit controller, peripheral bus express bus, graphics bus, processor or local bus using any of a variety of bus structures.
[0136] The electronic device 900 can also communicate with one or more external devices 1000 such as a keyboard or a pointing device, a Bluetooth device, etc.; other devices such as a storage device or an external effects device; and / or one or more devices that enable a user to interact with the electronic device 900; and / or one or more devices that enable the electronic device 900 to communicate with one or more other computing devices. Such communication can occur via an input / output (I / O) interface 950. Still yet, the electronic device 900 can communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network such as the Internet, via a network adapter 960. As depicted, the network adapter 960 can communicate with the other components of the electronic device 900 via the bus 930. It should be appreciated that although the network adapter 960 is depicted as a single component, the network adapter 960 can comprise two or more components that operate together to facilitate communication between the electronic device 900 and one or more other computing devices.
[0137] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to exemplary embodiments of the present disclosure, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into embodied by a plurality of modules or units.
[0138] Furthermore, the above-described diagrams are merely schematic illustrations of processes included in the method according to exemplary embodiments of the present disclosure, and are not intended for limiting purposes. It is readily understood that the processes shown in the above-described diagrams do not indicate or limit the time sequence of the processes. In addition, it is readily understood that the processes can be executed, for example, synchronously or asynchronously in a plurality of modules.
[0139] Those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software and also can be implemented by software in combination with necessary hardware, through the above description of the embodiments. Therefore, the technical solutions of the exemplary embodiments according to the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the methods according to the exemplary embodiments of the present disclosure.
[0140] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art to which the present disclosure pertains. The specification and embodiments are to be considered exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
Claims
1. A user classification method, characterized in that, The method includes: Acquire user data from multiple users, the user data including feature data of multiple feature variables and initial category labels for each user; Using user data corresponding to at least one category label in the initial category labels as positive example data and user data corresponding to other category labels besides the at least one category label as negative example data, the user data is converted into multiple first data combinations including positive and negative example data; using user data corresponding to any one category label in the initial category labels as positive example data and user data corresponding to any other category label besides the any one category label as negative example data, the user data is converted into multiple second data combinations including positive and negative example data, thereby realizing the transformation from a multi-classification problem to a binary classification problem; For each data combination in the first and second data combinations, the information content of each feature variable in each data combination is determined based on the number of positive and negative samples in each data combination. The information content of each feature variable in each data combination is summed according to the combination category of each data combination to obtain the first feature information content corresponding to the first data combination and the second feature information content corresponding to the second data combination. The information content of each feature variable is determined based on the first and second feature information contents to determine the feature score of each feature variable. Specifically, for each first data combination, the information content of each feature variable in the negative data of each data combination is calculated. For each second data combination, the information content of each feature variable in the positive and negative data of each second data combination is calculated sequentially. Based on the feature scores of each of the aforementioned feature variables, target feature variables are selected from the plurality of feature variables, and the plurality of users are divided into multiple categories using the feature data corresponding to the target feature variables.
2. The method according to claim 1, characterized in that, The step of determining the information content of each feature variable in each data combination based on the number of positive and negative samples in each data combination includes: The feature variables are binned, and the evidence weight of each bin corresponding to each feature variable is calculated; In each data combination, the positive sample rate and negative sample rate for each bin corresponding to each of the aforementioned feature variables are calculated respectively; Based on the evidence weights of each bin variable corresponding to each of the aforementioned feature variables, the differences between the positive and negative sample rates of each bin variable corresponding to each of the aforementioned feature variables are weighted and summed to obtain the information content of each of the aforementioned feature variables in each data combination.
3. The method according to claim 1, characterized in that, Determining the information content of each feature variable based on the first feature information content and the second feature information content includes: Calculate the information content of each feature variable with respect to each initial category label based on the first feature information content and the second feature information content; The information content of each feature variable with respect to each initial category label is summed to obtain the information content of each feature variable.
4. The method according to claim 1, characterized in that, The step involves selecting target feature variables from among the multiple feature variables based on the feature scores of each feature variable, and then classifying the multiple users into multiple categories using the feature data corresponding to the target feature variable, including: Among the feature scores of each feature variable, the feature variable whose feature score is greater than the feature score threshold is determined as the target feature variable; The feature data corresponding to the target feature variables are extracted to obtain target feature data. The target feature data is then classified using a pre-trained classification model to divide the multiple users into multiple categories.
5. The method according to claim 4, characterized in that, The step of classifying the target feature data using a pre-trained classification model to divide the multiple users into multiple categories includes: The target feature data is classified using a pre-trained logistic regression algorithm, which divides the multiple users into multiple categories.
6. A user classification device, characterized in that, The device includes: The acquisition module is used to acquire user data from multiple users, the user data including feature data of multiple feature variables and initial category labels for each user; The segmentation module is used to convert the user data into multiple first data combinations including positive and negative examples, taking user data corresponding to at least one category label in the initial category labels as positive example data and user data corresponding to other category labels besides the at least one category label as negative example data; and to convert the user data into multiple second data combinations including positive and negative examples, taking user data corresponding to any one category label in the initial category labels as positive example data and user data corresponding to any other category label besides the any one category label as negative example data, thereby realizing the transformation from a multi-class classification problem to a binary classification problem. The determination module is used to, for each data combination in the first data combination and the second data combination, determine the information content of each feature variable in each data combination based on the number of positive and negative samples in each data combination; sum the information content of each feature variable in each data combination according to the combination category of each data combination to obtain the first feature information content corresponding to the first data combination and the second feature information content corresponding to the second data combination; determine the information content of each feature variable based on the first and second feature information contents, so as to determine the feature score of each feature variable through the information content; wherein, for each first data combination, the information content of each feature variable in the negative data of each data combination is calculated; for each second data combination, the information content of each feature variable in the positive data and the information content in the negative data of each second data combination are calculated one by one; The classification module is used to filter out the target feature variable from the multiple feature variables based on the feature scores of each feature variable, and to divide the multiple users into multiple categories using the feature data corresponding to the target feature variable.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-5.
8. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-5 by executing the executable instructions.
Citation Information
Patent Citations
User feature data screening method and device and electronic equipment
CN112527851A
Feature binning method, electronic equipment and storage medium
CN113052222A
Customer classification method and device and storage medium
WO2019192130A1