Data Processing Method and Device for User Stratification
By automatically hierarchizing and classifying user behavior data, the problem of inefficiency in the existing technology is solved, and more efficient and accurate user classification is achieved.
Patent Information
- Application Number
- CN202111489956.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-12-08
AI Technical Summary
The existing user behavior data processing methods are inefficient and lack reliable analysis results, which cannot cope with the data processing needs in the big data era, and lack systematic hierarchical theoretical basis.
By obtaining the user's historical behavior data samples, sorting the number of users based on the characteristic values of the preset data characteristics, layering using the information entropy and inflection point methods, obtaining the user's hierarchical information, and classifying it based on the hierarchical information.
It realizes automated analysis of user behavior data, improves data processing efficiency, and improves the accuracy of user classification.
Smart Images

Figure CN114168442B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and more particularly, to a data processing method and device for user stratification. Background Art
[0002] With the rapid development of Internet technology and the advent of the big data era, a large amount of user behavior data has been generated in various business fields. These user behavior data have potential correlations with the behavioral characteristics of the users themselves. By analyzing user behavior data, users can be classified to provide matching information or services to the target needs of different categories of users, so as to improve the efficiency of information or service push and reduce the data processing pressure on the information or service provider.
[0003] Some existing user behavior data analysis methods generally rely on manually hard-separating behavioral data to stratify user groups. For such data processing methods, on the one hand, manual operations are inefficient and cannot cope with the surging data processing needs in the big data era; on the other hand, such stratification results lack a reliable stratification theoretical basis and do not fully consider the specificity of the data itself. Summary of the Invention
[0004] In view of the problems that existing methods for processing user behavior data are inefficient and lack reliable analysis results, the present disclosure provides a data processing method and device for user stratification.
[0005] According to a first aspect of the present disclosure, a data processing method is provided, which includes: obtaining historical behavior data samples of multiple users performing business operations; based on preset data features in the historical behavior data samples, sorting the characteristic values of the preset data features according to the number of users corresponding to the characteristic values of the preset data features to obtain a characteristic data set; based on change information between the number of users corresponding to different characteristic values of the preset data features, stratifying the characteristic data set to obtain stratification information of each user, the stratification information indicating which layer of the characteristic data set the user is in; and classifying each user based on the stratification information of each user.
[0006] Optionally, the preset data feature is a continuous variable feature, and the continuous variable feature refers to a data feature with a characteristic value of arbitrary value, wherein the step of stratifying the feature data set based on the change information between the number of users corresponding to different characteristic values of the preset data feature includes: dividing the feature data set into a preset number of layers according to a first preset condition, wherein the first preset condition is: stratifying the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized, and the information gain is determined according to the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification, wherein the information entropy is determined based on the characteristic value and the number of users corresponding to the characteristic value.
[0007] Optionally, the information gain is determined by the following expression:
[0008]
[0009] Among them, E(D) represents the information entropy of the data set D before stratification, and Respectively represent the characteristic values g of the preset data features i The first and second data sets are divided into two layers. and represent the information entropy of the first data set and the second data set respectively, and the operator |·| represents the number of samples in the set.
[0010] In the above expression, Among them, x k A feature value representing the preset data feature of data sample k.
[0011] In the above expression, Among them, m g represents the number of feature values of the preset data feature in the data set D, p j It represents the ratio of the number of users corresponding to the j-th eigenvalue to the total number of users in the dataset D.
[0012] In the above expression, Among them, m g1 Represents the first data set The number of characteristic values of the preset data features in p i Indicates that the number of users corresponding to the i-th eigenvalue accounts for the first data set The ratio of the total number of users in .
[0013] In the above expression, Among them, m g2 Represents the second data set The number of characteristic values of the preset data features in p l Indicates that the number of users corresponding to the lth eigenvalue accounts for the second data set The ratio of the total number of users in .
[0014] Optionally, the preset data feature is a discrete variable feature, and the discrete variable feature refers to a data feature having a characteristic value that is taken in a counting manner, wherein the step of stratifying the feature data set based on the change information between the number of users corresponding to different characteristic values of the preset data feature includes: dividing the feature data set into a preset number of layers according to a second preset condition, wherein the second preset condition includes: determining a first change rate between the number of users of adjacent first data samples and second data samples in the feature data set according to the arrangement order of the feature data set, when the first change rate is greater than a first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
[0015] Optionally, the second preset condition also includes: when the first change rate is less than or equal to the first preset threshold, determining the second change rate between the number of users of the second data sample and the third data sample adjacent to the second data sample; when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers; when the second change rate is less than or equal to the first preset threshold, determining the third change rate between the number of users of the third data sample and the first data sample; when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; when the third change rate is less than or equal to the second preset threshold, dividing the first data sample, the second data sample and the third data sample into data sets of the same layer.
[0016] Optionally, the preset data feature is a plurality of preset data features, wherein the step of classifying each user based on the hierarchical information of each user includes: determining the information entropy of each preset data feature based on the hierarchical information of each user; comparing the information entropy between the plurality of preset data features to determine the weight value of each preset data feature; determining the classification score of each user based on the weight value and the hierarchical information of each user, so as to classify each user according to the classification score.
[0017] Optionally, based on the weight value and the hierarchical information of each user, the step of determining the classification score of each user includes: based on the hierarchical information, determining the layer to which each user belongs under each preset data feature; based on the weight value of each preset data feature, performing weighted summation of the layers to which each user belongs under each preset data feature to determine the classification score of each user.
[0018] Optionally, the data processing method further includes: performing secondary classification on users with the same classification score according to the time when the users perform business operations.
[0019] Optionally, the step of secondary classifying users with the same classification score based on the time when the user performs a business operation includes: determining the length of time from the time when the user last performed a business operation to the current time, and comparing the time length with the execution time statistics, and secondary classifying users with the same classification score based on the comparison result, wherein the execution time statistics refers to the statistics of the length of time from the time when the user performs the business operation only once to the current time among all users; and / or, determining the length of time from the time when the user last performed a business operation to the current time, and comparing the time length with the repetition period of the user's own business operation execution, and secondary classifying users with the same classification score based on the comparison result.
[0020] Optionally, the execution time statistics are quantile statistics of the time length from the time when the business operation is executed to the current time for users who only execute the business operation once among all users.
[0021] Optionally, the business operation is an order transaction behavior, and the preset data features include at least one of the total transaction amount, order quantity, purchase cycle, and the number of categories penetrated by cross-category orders.
[0022] According to a second aspect of the present disclosure, a data processing device is provided, comprising: an acquisition unit configured to acquire historical behavior data samples of a plurality of users performing business operations; a sorting unit configured to sort the characteristic values of the preset data features according to the number of users corresponding to the characteristic values of the preset data features based on preset data features in the historical behavior data samples, to obtain a characteristic data set; a stratification unit configured to stratify the characteristic data set based on change information between the number of users corresponding to different characteristic values of the preset data features, to obtain stratification information of each user, the stratification information indicating which layer of the characteristic data set the user is in; and a classification unit configured to classify each user based on the stratification information of each user.
[0023] Optionally, the preset data feature is a continuous variable feature, and the continuous variable feature refers to a data feature with a characteristic value of any value, wherein the stratification unit is further configured to: divide the feature data set into a preset number of layers according to a first preset condition, wherein the first preset condition is: stratify the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized, and the information gain is determined according to the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification, wherein the information entropy is determined based on the characteristic value and the number of users corresponding to the characteristic value.
[0024] Optionally, the information gain is determined by the following expression:
[0025]
[0026] Among them, E(D) represents the information entropy of the data set D before stratification, and Respectively represent the characteristic values g of the preset data features i The first and second data sets are divided into two layers. and represent the information entropy of the first data set and the second data set respectively, and the operator |·| represents the number of samples in the set.
[0027] In the above expression, Among them, x k A feature value representing the preset data feature of data sample k.
[0028] In the above expression, Among them, m g represents the number of feature values of the preset data feature in the data set D, p j It represents the ratio of the number of users corresponding to the j-th eigenvalue to the total number of users in the dataset D.
[0029] In the above expression, Among them, m g1 Represents the first data set The number of characteristic values of the preset data features in p i Indicates that the number of users corresponding to the i-th eigenvalue accounts for the first data set The ratio of the total number of users in .
[0030] In the above expression, Among them, m g2 Represents the second data set The number of characteristic values of the preset data features in p lIndicates that the number of users corresponding to the lth eigenvalue accounts for the second data set The ratio of the total number of users in .
[0031] Optionally, the preset data feature is a discrete variable feature, and the discrete variable feature refers to a data feature with a characteristic value taken in a counting manner, wherein the stratification unit is further configured to: divide the feature data set into a preset number of layers according to a second preset condition, wherein the second preset condition includes: determining a first change rate between the number of users of adjacent first data samples and second data samples in the feature data set according to the arrangement order of the feature data set, and when the first change rate is greater than a first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
[0032] Optionally, the second preset condition also includes: when the first change rate is less than or equal to the first preset threshold, determining the second change rate between the number of users of the second data sample and the third data sample adjacent to the second data sample, and when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers; when the second change rate is less than or equal to the first preset threshold, determining the third change rate between the number of users of the third data sample and the first data sample, and when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; when the third change rate is less than or equal to the second preset threshold, dividing the first data sample, the second data sample and the third data sample into data sets of the same layer.
[0033] Optionally, the preset data feature is a plurality of preset data features, wherein the classification unit is further configured to: determine the information entropy of each preset data feature based on the hierarchical information of each user; compare the information entropy between the plurality of preset data features to determine the weight value of each preset data feature; determine the classification score of each user based on the weight value and the hierarchical information of each user, so as to classify each user according to the classification score.
[0034] Optionally, the classification unit is further configured to: determine the layer to which each user belongs under each preset data feature based on the hierarchical information; and perform weighted summation of the layers to which each user belongs under each preset data feature based on the weight value of each preset data feature to determine the classification score of each user.
[0035] Optionally, the classification unit is further configured to: perform secondary classification on users with the same classification score according to the time when the users perform business operations.
[0036] Optionally, the classification unit is further configured to: determine the length of time from the time when the user last performed a business operation to the current time, and compare the time length with the execution time statistics, and perform secondary classification on users with the same classification score based on the comparison result, wherein the execution time statistics refers to the statistics of the length of time from the time when the user performed the business operation only once to the current time among all users; and / or determine the length of time from the time when the user last performed a business operation to the current time, and compare the time length with the repetition period of the user's own business operation execution, and perform secondary classification on users with the same classification score based on the comparison result.
[0037] Optionally, the execution time statistics are quantile statistics of the time length from the time when the business operation is executed to the current time for users who only execute the business operation once among all users.
[0038] Optionally, the business operation is an order transaction behavior, and the preset data features include at least one of the total transaction amount, order quantity, purchase cycle, and the number of categories penetrated by cross-category orders.
[0039] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing a computer program, wherein when the computer program is executed by the processor, the data processing method according to the present disclosure is implemented.
[0040] According to a fourth aspect of the present disclosure, a computer-readable storage medium storing a computer program is provided. When the computer program is executed by a processor, the data processing method according to the present disclosure is implemented.
[0041] The data processing method and device according to the present disclosure can automatically analyze user behavior data without manual processing, thereby improving data processing efficiency. In addition, the method can also divide users into groups taking into account changes in the data itself, thereby improving the accuracy of user classification.
[0042] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flow chart of a data processing method according to an embodiment of the present disclosure is shown.
[0045] Figure 2 A flow chart showing the steps of classifying each user in the data processing method according to an embodiment of the present disclosure is shown.
[0046] Figure 3 A flow chart showing the step of determining the information entropy of each preset data feature in the data processing method according to an embodiment of the present disclosure is shown.
[0047] Figure 4 A schematic diagram of a classification framework for secondary classification of users in a data processing method according to an embodiment of the present disclosure is shown.
[0048] Figure 5 A schematic block diagram of a data processing device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, every other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present disclosure.
[0050] It should be noted that the term “comprising” will be used in the embodiments of the present disclosure to indicate the existence of the features claimed thereafter, but does not exclude the addition of other features.
[0051] The present disclosure relates to a data processing method and apparatus. It is worth noting that, before the present disclosure was filed, existing methods for processing user behavior data were inefficient and lacked reliable analysis results.
[0052] Specifically, existing methods for processing user behavior data generally use the RFM model for user stratification analysis. This involves evaluating user behavior and stratifying users based on three metrics: Recency (R), Frequency (F), and Monetary (M). However, in these methods, when stratifying by a specific metric, the stratification threshold is typically selected based on empirical methods and artificially hard-separated values. There is no reliable threshold selection method, and no systematic theoretical basis for dividing metric values into intervals.
[0053] In addition, since the user stratification method of the RFM model cannot achieve automated stratification, for different data obtained in different business scenarios, each type of data or each acquired data needs to be manually segmented, and automated data processing cannot be achieved, resulting in low data analysis efficiency.
[0054] In view of this, the first aspect of the present disclosure provides a data processing method, which can automatically analyze user behavior data without manual processing, thereby improving data processing efficiency. The method can also divide users based on changes in the data itself, thereby improving the accuracy of user classification.
[0055] Figure 1 FIG. 1 shows a flow chart of a data processing method according to an embodiment of the present disclosure. Figure 1 As shown, the data processing method according to the embodiment of the present disclosure may include:
[0056] In step S10, historical behavior data samples of multiple users performing business operations may be obtained.
[0057] In this step, a business operation refers to an action performed by a user, such as an order transaction performed over the Internet. Here, the order transaction can be an order transaction on an e-commerce platform, or an order transaction such as an airline order, a high-speed rail order, or a takeout order.
[0058] When users perform business operations, they generate behavioral data. For example, when users conduct order transactions, they generate behavioral data including order time, transaction amount, order category, and order quantity. Historical behavioral data samples can be the behavioral data of multiple users performing the same business operation within a predetermined time period. For example, it can be the transaction behavior data of all users of a certain brand on a certain online trading platform over a period of time. This historical behavioral data sample can be obtained from any data source via a data interface.
[0059] A user can be an individual, a group, or any entity. Each user has a unique user identifier, such as a user ID, when performing business operations. All behavioral data is stored corresponding to the user identifier.
[0060] Here, it should be noted that, although the application scenario in which the business operation is an order transaction behavior is described as an example in this article, the application scenario of the data processing method according to the embodiment of the present disclosure is not limited to this. It can also be applied to other application scenarios that require analysis of user behavior data to classify users. For example, it can be the classification of users in any Internet operation service. For example, the business operation can also be the user's browsing behavior, downloading behavior, etc. of network resources.
[0061] In step S20, based on the preset data features in the historical behavior data sample, the feature values of the preset data features may be sorted according to the number of users corresponding to the feature values of the preset data features to obtain a feature data set.
[0062] In this step, the preset data features can be determined based on the business operation, which can be indicators that can reflect the characteristics of the business operation. The same business operation can correspond to multiple preset data features, and different preset data features can reflect the characteristics of the business operation from different dimensions.
[0063] When the business operation is an order transaction, the preset data features may include at least one of the following: gross merchandise volume (GMV), number of orders, purchase cycle, and number of categories penetrated by cross-category orders. Here, the gross merchandise volume may be the total amount of orders executed by the user within a predetermined time period, the number of orders may be the number of order transactions executed by the user within the predetermined time period, the purchase cycle may be the average time it takes for the user to execute a transaction within the predetermined time period, and the number of categories penetrated by cross-category orders may be the number of order categories involved in transactions executed by the user within the predetermined time period.
[0064] The number of cross-category order penetration categories can represent the user's interest in the provider of business operation services. The larger the number of cross-category order penetration categories, the higher the user's interest in the provider of business operation services. Therefore, when the number of cross-category order penetration categories is used as one of the preset data features, it can provide guidance for the provider to push differentiated information. For example, users with a larger number of cross-category order penetration categories can be provided with a wider range of information or services.
[0065] The feature value may refer to the data value of a preset data feature that appears in a historical behavior data sample. As an example, Tables 1 and 2 below show the user distribution data for the total transaction amount (GMV) and the number of orders when the business operation is an order transaction behavior.
[0066] Table 1:
[0067] GMV Number of users 4 38 65 8584 67 78 68 2544 69 1259 76 6785 78 3972 79 925 83 15080 85 6005
[0068] Table 2:
[0069] Order quantity Number of users 1 313213 2 132802 3 30729 4 16319 5 6065 6 3986 7 1695 8 955 9 543 10 334
[0070] According to embodiments of the present disclosure, the number of users corresponding to each feature value can be counted and sorted by the number of users to obtain a feature dataset. In the method according to embodiments of the present disclosure, the feature values of the same preset data feature can be sorted in descending order of the number of users. This can be advantageous in subsequent user stratification processing, which will be described in detail below.
[0071] As an example, Table 3 below shows GMV distribution data sorted by the number of users.
[0072] Table 3:
[0073] GMV Number of users 251 50108 167 39289 334 25796 335 25563 502 25194 189 24832 284 22102 83 15080 130 11663 198 9063
[0074] In step S30, the feature data set may be layered based on the variation in the number of users corresponding to different feature values of the preset data feature to obtain layer information for each user. Here, the layer information may indicate which layer the user is in the feature data set.
[0075] As an example, a feature dataset may be stratified according to the variable type of a preset data feature.
[0076] In one case, the preset data feature may be a continuous variable feature. Here, the continuous variable feature may refer to a data feature with a feature value of any value. For example, when the business operation is an order transaction behavior, GMV and purchase cycle may be continuous variable features.
[0077] For continuous variable features, the step of stratifying the feature data set may include: dividing the feature data set into a preset number of layers according to a first preset condition.
[0078] Here, the first preset condition may be: stratifying the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized.
[0079] Information gain can be determined based on the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification. Information entropy can be determined based on the eigenvalue and the number of users corresponding to the eigenvalue.
[0080] Specifically, we can find the eigenvalue cutoff point for the feature data set and stratify the feature data set based on the eigenvalue cutoff point. For example, we can stratify data samples with eigenvalues greater than or equal to the eigenvalue cutoff point into one layer, and data samples with eigenvalues less than the eigenvalue cutoff point into another layer.
[0081] Here, the two-layer data set divided based on the eigenvalue split point can meet the first preset condition. Specifically, the eigenvalue split point can be determined by maximizing the information gain between the information entropy of the data set before stratification and the information entropy of the two data sets after stratification.
[0082] Information entropy is a measure of the uncertainty of random variables in information, which can be expressed by the following formula (1):
[0083]
[0084] Among them, X represents the random variable in the information, if p x = 0, then 0log0 = 0. Usually, the logarithm in the above formula is based on 2 or e (natural logarithm), and the unit of entropy is called bit or nat respectively.
[0085] Based on the above formula (1), the information entropy E(D) of the data set before stratification can be expressed by the following formula (2):
[0086]
[0087] Among them, m g The number of eigenvalues of the preset data features in the dataset D, p j It represents the ratio of the number of users corresponding to the jth eigenvalue to the total number of users in dataset D. Here, both the number of users and the total number of users refer to the number of independent users. That is, the same user performing the same business operation multiple times is counted as one user, and the same user is not counted repeatedly.
[0088] Similarly, the information entropy of the first and second datasets after stratification can be expressed by the following equations (3) and (4):
[0089]
[0090]
[0091] in, and Respectively represent the characteristic values g of the preset data features i As the first and second datasets of the split point layer, m g1 Represents the first data set The number of eigenvalues of the preset data features in p i Indicates that the number of users corresponding to the i-th eigenvalue accounts for the first data set The proportion of the total number of users in m g2 Represents the second data set The number of eigenvalues of the preset data features in p l Indicates that the number of users corresponding to the lth eigenvalue accounts for the second data set As an example, when the business operation is an order transaction, the preset data feature can be GMV, and the feature value g i It can be the data value of GMV. When there are multiple preset data features, the calculation process described here can be performed for each preset data feature and its feature value.
[0092] In formula (3) and formula (4), Among them, x k The feature value representing the preset data feature of data sample k.
[0093] Based on the above formulas (2), (3) and (4), the information gain between the information entropy of the data set before stratification and the information entropy of the two data sets after stratification can be determined by the following formula (5):
[0094]
[0095] in, and represent the information entropy of the first and second data sets respectively, and the operator |·| represents the cardinality of the set, that is, the number of samples in the set.
[0096] In the above formula (5), information gain can represent the degree to which the uncertainty of the information about the feature is reduced. The greater the information gain, the greater the degree of uncertainty reduction. In the data processing method according to the embodiment of the present disclosure, users can be divided into two levels based on the feature value cut-off points of the preset data features. In the process of selecting the feature value cut-off points, a principle similar to maximizing information gain in a decision tree is used. In this way, the uncertainty of the two-layer data set after stratification can be minimized, thereby achieving accurate data classification.
[0097] In the data processing method according to an embodiment of the present disclosure, the feature dataset may be divided into a preset number of layers. Here, the preset number of layers may be any predetermined number, for example, 5 layers. The layering operation may be performed multiple times on the feature dataset until the feature dataset is divided into the preset number of layers.
[0098] Specifically, the sorted feature dataset can be initially stratified according to the first preset condition above to obtain two stratified datasets. Then, according to the first preset condition above, the dataset with the largest information entropy among the two stratified datasets can be subjected to secondary stratification to obtain two secondary stratified datasets. Then, according to the first preset condition above, the dataset with the largest information entropy among all current datasets (i.e., the dataset with the largest non-information entropy after the initial stratification and the two datasets obtained after the secondary stratification) can be further stratified, in this way, until the feature dataset is divided into the preset number of layers.
[0099] As an example, when the business operation is an order transaction behavior, the above interval stratification method based on information entropy is used to stratify users of a certain brand according to GMV. The resulting GMV stratification intervals are [64,284), [284,502), [502,671), [671,1004), [1004,120383]. The total number of users corresponding to each interval is 264650, 132149, 59377, 29866, and 21219 respectively.
[0100] In addition, in step S30, when the characteristic values of the same preset data feature are sorted in order from large to small according to the number of users in step S20, since the split point trial calculation can be performed on the characteristic values with a larger number of users in priority during the user stratification processing, the characteristic value split point can be found more quickly, thereby improving the data processing speed.
[0101] In another case, the preset data feature may be a discrete variable feature. Here, the discrete variable feature may refer to a data feature having a characteristic value that is taken in a counting manner. For example, when the business operation is an order transaction behavior, the purchase cycle and the number of categories penetrated by cross-category orders may be discrete variable features.
[0102] For discrete variable features, the step of stratifying the feature data set may include: dividing the feature data set into a preset number of layers according to a second preset condition.
[0103] Here, the second preset condition may include: determining the first change rate between the number of users of adjacent first data samples and second data samples according to the arrangement order of the feature data set; when the first change rate is greater than the first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
[0104] Specifically, taking the order quantity distribution data shown in Table 2 as an example, in Table 2, the order quantity is arranged in descending order of the number of users. The first change rate can be the proportion of the decrease in the number of users corresponding to each increase in the order quantity. The first preset threshold can be, for example, 50%.
[0105] For example, the number of orders in the first data sample can be i, the number of orders in the second data sample can be i+1, and the number of users in the first data sample can be |u i |, the number of users of the second data sample can be |u i+1 |.
[0106] When the first change rate is greater than the first preset threshold, that is, when the number of users of the second data sample decreases by more than 50% compared with the number of users of the first data sample, that is, |u i+1 |<0.5*|u i |, the order quantity i+1 of the second data sample can be used as the stratification inflection point, and the first data sample and the second data sample can be divided into different layers, that is, the users corresponding to the first data sample are in one layer, and the users corresponding to the second data sample and the data sample whose order quantity is greater than or equal to the order quantity i+1 of the second data sample are in another layer. Here, i can be taken from 1 to the maximum value of the order quantity in the feature data set. Therefore, according to the above second preset condition, the users of the second data sample and the users corresponding to the data sample whose order quantity is greater than or equal to the order quantity of the second data sample can continue to be stratified.
[0107] When the first change rate is less than or equal to the first preset threshold, when the number of users of the second data sample decreases by less than or equal to 50% compared with the number of users of the first data sample, that is, |u i+1 |≥0.5*|u i |, the first data sample and the second data sample are divided into the data set of the same layer, that is, users who have placed orders i and i+1 times are divided into the same layer.
[0108] As an example, when the first change rate is less than or equal to a first preset threshold, the second preset condition may also include: determining a second change rate between the number of users of the second data sample and a third data sample adjacent to the second data sample; and when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers.
[0109] Taking the order quantity distribution data as an example, the order quantity of the third data sample can be i+2, and the number of users of the third data sample can be |u i+2 |, when the number of users in the second data sample |u i+1 |Number of users with the first data sample|u iWhen the decrease ratio is less than or equal to 50%, the number of users of the second data sample and the third data sample can be compared.
[0110] Specifically, when the proportion of the number of users of the third data sample decreases compared to the number of users of the second data sample by more than 50%, the order quantity i+2 of the third data sample can be used as a stratification inflection point to divide the users of the second data sample into one layer, and the users of the third data sample and the users corresponding to the data samples with an order quantity greater than or equal to the order quantity i+2 of the third data sample into another layer. Here, the users of the third data sample and the users corresponding to the data samples with an order quantity greater than or equal to the order quantity of the third data sample can continue to be stratified according to the above-mentioned second preset condition.
[0111] As an example, the second preset condition may also include: when the second change rate is less than or equal to the first preset threshold, determining the third change rate between the number of users of the third data sample and the first data sample; when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; when the third change rate is less than or equal to the second preset threshold, dividing the first data sample, the second data sample and the third data sample into data sets of the same layer.
[0112] Continuing with the order quantity distribution data as an example, when the percentage decrease in the number of users of the third data sample compared to the number of users of the second data sample is less than or equal to the first preset threshold of 50%, it is possible to compare whether the percentage decrease in the number of users of the first data sample compared to the number of users of the first data sample (i.e., the third change rate) is greater than the second preset threshold. For example, if the second preset threshold is 60%, if the third change rate is greater than 60% of the second preset threshold, i.e., |u i+2 |<0.4*|u i |, then the order quantity i+2 of the third data sample is taken as a stratification inflection point. If the third change rate is less than or equal to the second preset threshold value 60%, the users of the first data sample, the second data sample and the third data sample are classified into the same layer.
[0113] Here, it should be noted that the first preset threshold and the second preset threshold mentioned above are not limited to 50% and 60%, and they can be set according to actual applications.
[0114] As an example, the specific logic for starting inflection point stratification based on the order quantity distribution data above and the order quantity i can be as follows:
[0115]
[0116]
[0117] According to the second preset condition, stratification may be performed starting from the first data sample in the feature data set until the feature data set is divided into a preset number of layers.
[0118] As an example, when the business operation is an order transaction behavior, the above interval stratification method based on the inflection point method is used to stratify users of a certain brand according to the number of orders. The resulting order quantity stratification intervals are [1,2), [2,3), [3,5), [5,7), [7,59]. The total number of users corresponding to each interval is 307475, 126829, 44669, 9321, and 3746 respectively.
[0119] As described above, according to the data processing method of the present disclosure, when the preset data features are continuous variables, an interval binning method based on information entropy is used for user stratification; when the preset data features are discrete variables, an interval binning method based on the inflection point method is used for user stratification. Thus, by using different user stratification methods based on the type of preset data features, the accuracy of data processing for user stratification can be improved.
[0120] In step S40, each user may be classified based on the hierarchical information of each user.
[0121] According to the data processing method of the embodiment of the present disclosure, the preset data feature may be one or more.
[0122] When there is only one preset data feature, users can be classified into corresponding tiers based on their tier information, with all users being classified into the preset number of tiers. For example, if the preset number of tiers is 5, the tier information may indicate whether a user belongs to tier 1, tier 2, tier 3, tier 4, or tier 5.
[0123] In the case of multiple preset data features, stratification information for each user can be obtained for each preset data feature, and each user is classified into a layer from the preset number of layers under each preset data feature. Specifically, the feature dataset can be stratified for each preset data feature. For example, the operations of steps S10 to S30 above are performed for each preset data feature to obtain stratification information for each user for each preset data feature.
[0124] For example, as described above, the preset data features may include total transaction amount, order quantity, purchase cycle, and the number of categories penetrated by cross-category orders. In this case, the hierarchical information of all users may be as shown in Table 4 below:
[0125] Table 4:
[0126]
[0127] Therefore, in the case where there are multiple preset data features, the user's stratification under each dimension in all the preset data features may be considered to determine the user's final stratification to classify the user.
[0128] Specifically, if Figure 2 As shown, step S40 may include the following steps:
[0129] In step S41 , the information entropy of each preset data feature may be determined based on the hierarchical information of each user.
[0130] As an example, Figure 3 As shown, in step S411, data normalization processing can be performed on the user's hierarchical information.
[0131] For example, the user's hierarchical data can be normalized to between 0 and 1. Specifically, the user's hierarchical data can be normalized using the following formula (6):
[0132]
[0133] Among them, a ij Indicates the hierarchical data of the i-th user among all users under the j-th preset data feature among all preset data features. For example, the hierarchical data of the first user under the first preset data feature in Table 4 above is 1. j Represents all hierarchical data under the jth preset data feature. min(a j ) represents the minimum value of all hierarchical data under the j-th preset data feature, max(a j ) represents the maximum value of all hierarchical data under the j-th preset data feature.
[0134] In step S412 , the user weight of each user under each preset data feature may be determined based on the user stratification information after data normalization processing.
[0135] Specifically, the user weight P of the i-th user under the j-th preset data feature is ij It can be determined by the following formula (7):
[0136]
[0137] In step S413 , the information entropy of each preset data feature may be determined based on the user weight of each user under each preset data feature.
[0138] Specifically, the information entropy E of the j-th preset data feature j It can be determined by the following formula (8):
[0139]
[0140] Return to reference Figure 2 In step S42, the information entropy between the plurality of preset data features may be compared to determine the weight value of each preset data feature.
[0141] Specifically, the information entropy of each preset data feature can be determined based on the above formula (8), and the impact of each preset data feature on the entire business operation can be determined by comparing the size relationship of the information entropy between multiple preset data features.
[0142] As an example, the weight value ω of the j-th preset data feature j It can be determined by the following formula (9):
[0143]
[0144] Wherein, m is the total number of preset data features, j=1,2,...,m.
[0145] In step S43 , a classification score of each user may be determined based on the weight value and the hierarchical information of each user, so as to classify each user according to the classification score.
[0146] As an example, based on the hierarchical information, the layer to which each user belongs under each preset data feature can be determined, and based on the weight value of each preset data feature, the layer to which each user belongs under each preset data feature can be weighted summed to determine the classification score of each user.
[0147] Specifically, the weight value of the preset data feature can be used to weight the hierarchical data of each preset data feature of each user to obtain the final classification score. For example, the classification score s of the i-th user is i It can be expressed by the following formula (10):
[0148]
[0149] As an example, when the preset number of layers is 5, the classification score s i The possible values are 1, 2, 3, 4 and 5.
[0150] As described above, users can be classified based on classification scores. The same information or services can be pushed to users with the same classification scores, and different information or services can be pushed to users in different classifications, so as to improve the efficiency of information or service push and reduce the data processing pressure on the information or service provider.
[0151] Refer to above Figures 1 to 3Describes the process of determining the classification score of each user based on the layer to which the user belongs under the preset data features to classify the user. Figure 4 Describe,the process of secondary classification of users considering the time dimension.
[0152] The data processing method according to the embodiment of the present disclosure may further include: performing secondary classification on users with the same classification score according to the time when the users perform the business operation.
[0153] In this step, the time when the user performs the business operation refers to the time when the business operation occurs. In the case where the business operation is an order transaction behavior, the time may refer to the time when the user places the order.
[0154] In one example, the step of secondary classifying users with the same classification score may include determining the length of time from the time the user last performed a business operation to the current time, comparing the length of time with execution time statistics, and secondary classifying the users with the same classification score based on the comparison result. Here, the execution time statistics may refer to the statistics of the length of time from the time the user performed the business operation to the current time for users who performed only one business operation among all users.
[0155] As an example, the execution time statistics can be the quantile statistics of the length of time from the time when the user who only performs the business operation once among all users performs the business operation to the current time. For example, the length of time from the time when the user who only performs the business operation once among all users performs the business operation to the current time can be represented in the form of a vector or a set, and the quantile of the vector or set can be calculated, for example, the upper quartile of the vector or set can be calculated. However, it should be noted that the upper quartile used in this article is only an example, and the value of the quantile can be selected according to the actual application. For example, the 0.8 quantile can also be used.
[0156] Specifically, users whose latest business operation execution time is greater than the time statistic may be classified into one category, and users whose latest business operation execution time is less than or equal to the time statistic may be classified into another category.
[0157] In addition to or in place of the above example, the step of secondary classification of users with the same classification score may also include: determining the length of time from the time when the user last performed a business operation to the current time, and comparing the time length with the repetition cycle of the user's own business operation, and secondary classification of users with the same classification score based on the comparison result.
[0158] Here, the repetition period of the user's own business operation execution can refer to the average time interval of the user's historical business operation execution. Specifically, the repetition period F of the i-th user is i It can be expressed by the following formula (11):
[0159]
[0160] Among them, I i t is the time between the first and last execution of a business operation by the i-th user, i is the total number of business operations performed by the i-th user within the time length.
[0161] Specifically, users whose latest business operation execution time is greater than the user's own recurrence period may be classified into one category, and users whose latest business operation execution time is less than or equal to the user's own recurrence period may be classified into another category.
[0162] According to the above steps of the embodiment of the present disclosure, users with the same classification score can be more accurately divided from the time dimension of executing business operations, taking into account the time statistics of multiple users and / or the repetitive cycle of each user's own execution of business operations, so that user classification is more detailed and accurate, thereby providing more targeted information or services for users in different categories.
[0163] In addition, according to the above steps of the embodiment of the present disclosure, since the time dimension is introduced, users can be stratified in real time according to the update of user historical behavior data.
[0164] In addition, according to the above steps of the embodiment of the present disclosure, as historical behavior data continues to accumulate, the classification of users can be more accurate over time, so that the method can be automatically optimized and the accuracy of classification can be continuously improved.
[0165] The following will refer to Figure 4 The process of secondary classification of users is described in detail. As an example, in the case where the business operation is an order transaction behavior, when the preset number of layers is 5, the classification score can be 1, 2, 3, 4 and 5. Users with a classification score of 1 can be called introduction users, users with classification scores of 2 and 3 can be called growth users, and users with classification scores of 4 and 5 can be called mature users. In addition, in the case where the business operation is an order transaction behavior, the repetitive cycle of the user's own execution of the business operation can refer to the repurchase cycle of the user's own orders.
[0166] The length of time from the last time the i-th user performed a business operation to the current time is T i , the repurchase cycle of the i-th user is F i, the time length from the time when all users who have only performed a business operation once to the current time can be expressed in the form of a vector or set Q. The execution time statistic q can be the upper quartile of the vector or set Q, that is, q = quantiel(Q,0.75). Based on the above time length T i , repurchase cycle F i and the execution time statistic q to perform secondary classification on users in each classification score.
[0167] Specifically, for the introduction period users with a classification score of 1, the time length T i , repurchase cycle F i The execution time statistic q is used to secondary classify the growth stage users into the churn stage or the introduction stage.
[0168] In one example, if a user has only performed one business operation, the user can be classified into the churn period or retained in the introduction period based on whether the time from the last time the user performed the business operation to the current time is relatively long among users with the same classification score. Figure 4 As shown, if T i ≤q, then the user in the introduction period will remain in the introduction period; if T i >q, then the users in the introduction period are classified into the churn period.
[0169] In another example, if a user performs more than one business operation, the user can be classified into the churn period or retained in the introduction period based on whether the time from the last time the user performed the business operation to the current time exceeds the user's own repetition period. Figure 4 As shown, if T i ≤F i , then the user in the introduction period will remain in the introduction period; if T i >F i , then the users in the introduction period are classified into the churn period.
[0170] For users in the growth stage with classification scores of 2 and 3, the time length T i , repurchase cycle F i And the execution time statistics q can be used to classify the growth stage users into the growth stage, decline stage or churn stage. For example, Figure 4 As shown, if T i ≤F i , then the growth-stage user will be retained in the growth stage; if F i ≤T i ≤q, then the user in the growth stage is classified into the decline stage; if T i >q, then the user in the growth stage is classified into the churn period.
[0171] For mature users with classification scores of 4 and 5, the time length T i , repurchase cycle F i And the execution time statistics q can be used to classify the growing users into mature, declining and churn stages. Figure 4 As shown, if T i ≤F i , then the mature user will be retained in the mature period; if F i ≤T i ≤q, then the mature user is classified into the decline period; if T i >q, then the mature user is classified into the churn period.
[0172] Another aspect of the present disclosure relates to a data processing apparatus. Figure 5 A schematic block diagram of a data processing device according to an exemplary embodiment of the present disclosure is shown.
[0173] like Figure 5 As shown, the data processing apparatus according to the exemplary embodiment of the present disclosure includes an acquiring unit 100 , a sorting unit 200 , a stratification unit 300 , and a classification unit 400 .
[0174] The acquisition unit 100 may be configured to acquire historical behavior data samples of multiple users performing business operations.
[0175] The sorting unit 200 may be configured to sort the feature values of the preset data features based on the preset data features in the historical behavior data sample according to the number of users corresponding to the feature values of the preset data features to obtain a feature data set.
[0176] The stratification unit 300 may be configured to stratify the feature data set based on the variation information between the number of users corresponding to different feature values of the preset data feature, and obtain stratification information of each user. Here, the stratification information indicates which layer of the feature data set the user belongs to.
[0177] The classification unit 400 may be configured to classify each user based on hierarchical information of each user.
[0178] As an example, the preset data feature is a continuous variable feature, which refers to a data feature with a characteristic value of any value. The stratification unit 300 can also be configured to: divide the feature data set into a preset number of layers according to a first preset condition. The first preset condition is: stratify the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized. Here, the information gain is determined based on the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification, and the information entropy is determined based on the characteristic value and the number of users corresponding to the characteristic value.
[0179] As an example, information gain is determined by the following expression:
[0180]
[0181] Among them, E(D) represents the information entropy of the data set D before stratification, and Respectively represent the characteristic values g of the preset data features i The first and second data sets are divided into two layers. and represent the information entropy of the first and second data sets respectively, and the operator |·| represents the number of samples in the set.
[0182] In the above expression, Among them, x k The feature value representing the preset data feature of data sample k.
[0183] In the above expression, Among them, m g The number of eigenvalues of the preset data features in the dataset D, p j It represents the ratio of the number of users corresponding to the j-th eigenvalue to the total number of users in the dataset D.
[0184] In the above expression, Among them, m g1 Represents the first data set The number of eigenvalues of the preset data features in p i Indicates that the number of users corresponding to the i-th eigenvalue accounts for the first data set The ratio of the total number of users in .
[0185] In the above expression, Among them, m g2 Represents the second data set The number of eigenvalues of the preset data features in p l Indicates that the number of users corresponding to the lth eigenvalue accounts for the second data set The ratio of the total number of users in .
[0186] As an example, the preset data feature is a discrete variable feature, which refers to a data feature with a characteristic value obtained in a counting manner. The stratification unit 300 can also be configured to: divide the feature data set into a preset number of layers according to a second preset condition. The second preset condition includes: determining a first change rate between the number of users of adjacent first data samples and second data samples in the feature data set according to the arrangement order of the feature data set; when the first change rate is greater than a first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
[0187] As an example, the second preset condition also includes: when the first change rate is less than or equal to the first preset threshold, determining the second change rate between the number of users of the second data sample and the third data sample adjacent to the second data sample, and when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers; when the second change rate is less than or equal to the first preset threshold, determining the third change rate between the number of users of the third data sample and the first data sample, and when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; when the third change rate is less than or equal to the second preset threshold, dividing the first data sample, the second data sample and the third data sample into data sets of the same layer.
[0188] As an example, the preset data features are multiple preset data features, and the classification unit 400 can also be configured to: determine the information entropy of each preset data feature based on the hierarchical information of each user; compare the information entropy between the multiple preset data features to determine the weight value of each preset data feature; determine the classification score of each user based on the weight value and the hierarchical information of each user, so as to classify each user according to the classification score.
[0189] As an example, the classification unit 400 can also be configured to: determine the layer to which each user belongs under each preset data feature based on the hierarchical information; and perform weighted summation of the layers to which each user belongs under each preset data feature based on the weight value of each preset data feature to determine the classification score of each user.
[0190] As an example, the classification unit 400 may also be configured to perform secondary classification on users with the same classification score according to the time when the users perform the service operation.
[0191] As an example, the classification unit 400 can also be configured to: determine the length of time from the time when the user last performed a business operation to the current time, and compare the time length with the execution time statistics, and perform secondary classification on users with the same classification score based on the comparison results, wherein the execution time statistics refers to the statistics of the length of time from the time when the user performs the business operation only once to the current time among all users; and / or determine the length of time from the time when the user last performed a business operation to the current time, and compare the time length with the repetition period of the user's own business operation execution, and perform secondary classification on users with the same classification score based on the comparison results.
[0192] As an example, the execution time statistics are quantile statistics of the time length from the execution time of the business operation to the current time for users who only execute the business operation once among all users.
[0193] As an example, the business operation is an order transaction behavior, and the preset data features include at least one of the total transaction amount, the number of orders, the purchase cycle, and the number of categories penetrated by cross-category orders.
[0194] It should be noted that the acquisition unit 100, the sorting unit 200, the stratification unit 300 and the classification unit 400 can be based on the above Figures 1 to 4 The data processing method in the method embodiment shown executes the corresponding steps in the method, for example, through machine-readable instructions executable by the acquisition unit 100, the sorting unit 200, the stratification unit 300 and the classification unit 400. The specific implementation methods of the acquisition unit 100, the sorting unit 200, the stratification unit 300 and the classification unit 400 can be found in the method embodiment described above and will not be repeated here.
[0195] The present disclosure also provides an electronic device, which includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the electronic device can be operated according to the above Figures 1 to 4 The data processing method in the method embodiment shown executes the corresponding steps in the method, for example, through machine-readable instructions executable by an electronic device. The specific implementation method of the electronic device can be found in the method embodiment described above and will not be repeated here.
[0196] The present disclosure also provides a computer-readable storage medium storing a computer program, which can execute the above-mentioned Figures 1 to 4 The steps of the data processing method in the method embodiment shown and the specific implementation thereof can be found in the method embodiment, which will not be described in detail here.
[0197] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0198] In the embodiments provided in this disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, other division methods may be used. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not implemented.
[0199] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present disclosure.
[0200] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0201] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0202] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A data processing method, characterized in that: The data processing method includes: Obtain historical behavior data samples of multiple users performing business operations; Based on the preset data features in the historical behavior data sample, the feature values of the preset data features are sorted according to the number of users corresponding to the feature values of the preset data features to obtain a feature data set; Based on the change information between the number of users corresponding to different characteristic values of the preset data characteristic, the characteristic data set is layered to obtain layer information of each user, wherein the layer information indicates which layer of the characteristic data set the user belongs to; Classify each user based on their hierarchical information. The preset data feature is a continuous variable feature, which refers to a data feature with a characteristic value of any value. The step of stratifying the feature data set based on the change information between the number of users corresponding to different feature values of the preset data feature includes: dividing the feature data set into a preset number of layers according to a first preset condition, The step of dividing the feature data set into a preset number of layers according to the first preset condition includes: performing a primary stratification on the feature data set according to the first preset condition to obtain a stratified data set; performing a secondary stratification on the data set with the largest information entropy in the stratified data set according to the first preset condition to obtain a secondary stratified data set; and performing stratification on the data set with the largest non-information entropy after the primary stratification and the data set with the largest information entropy in the secondary stratified data set according to the first preset condition, until the feature data set is divided into the preset number of layers. The first preset condition is: stratifying the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized, wherein the information gain is determined based on the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification, and the information entropy is determined based on the eigenvalue and the number of users corresponding to the eigenvalue. Alternatively, the preset data feature is a discrete variable feature, which refers to a data feature having a characteristic value obtained in a counting manner. The step of stratifying the feature data set based on the change information between the number of users corresponding to different feature values of the preset data feature includes: dividing the feature data set into a preset number of layers according to a second preset condition, The second preset condition includes: determining the first change rate between the number of users of the adjacent first data sample and the second data sample in the feature data set according to the arrangement order of the feature data set, and when the first change rate is greater than a first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
2. The data processing method according to claim 1, wherein: The information gain is determined by the following expression: in, Represents the dataset before stratification D The information entropy of and Respectively represent the characteristic values of the preset data features The first and second data sets are divided into two layers. and Respectively represent the information entropy of the first data set and the second data set, the operator represents the number of samples in the set, in, , ,in, Represents data samples k The characteristic value of the preset data characteristic, in, ,in, Representation dataset D The number of characteristic values of the preset data characteristics in Indicates the j The number of users corresponding to the feature value accounts for the D The proportion of the total number of users in in, ,in, Represents the first data set The number of characteristic values of the preset data characteristics in Indicates the i The number of users corresponding to the characteristic values accounts for the first data set The proportion of the total number of users in in, ,in, Represents the second data set The number of characteristic values of the preset data characteristics in Indicates the l The number of users corresponding to the feature value accounts for the second data set The ratio of the total number of users in .
3. The data processing method according to claim 1, wherein: The second preset condition also includes: When the first change rate is less than or equal to the first preset threshold, determining a second change rate between the number of users of the second data sample and a third data sample adjacent to the second data sample; when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers; When the second change rate is less than or equal to the first preset threshold, determining a third change rate between the number of users of the third data sample and the first data sample, and when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; When the third change rate is less than or equal to a second preset threshold, the first data sample, the second data sample, and the third data sample are divided into data sets of the same layer.
4. The data processing method according to any one of claims 1 to 3, characterized in that: The preset data feature is a plurality of preset data features, The step of classifying each user based on the hierarchical information of each user includes: Determine the information entropy of each preset data feature based on the hierarchical information of each user; Comparing the information entropy between the plurality of preset data features to determine a weight value for each preset data feature; Based on the weight value and the hierarchical information of each user, a classification score of each user is determined to classify each user according to the classification score.
5. The data processing method according to claim 4, characterized in that: The step of determining the classification score of each user based on the weight value and the hierarchical information of each user includes: Based on the hierarchical information, determining the layer to which each user belongs under each preset data feature; Based on the weight value of each preset data feature, the layer to which each user belongs under each preset data feature is weighted and summed to determine the classification score of each user.
6. The data processing method according to claim 1, wherein: The data processing method further includes: Users with the same classification score are reclassified based on the time when the users perform business operations.
7. The data processing method according to claim 6, wherein: The steps of secondary classification of users with the same classification score based on the time when the users performed business operations include: Determine the length of time from the time the user last performed a business operation to the current time, compare the length of time with the execution time statistics, and perform secondary classification on users with the same classification score based on the comparison results, wherein the execution time statistics refer to the statistics of the length of time from the time the user performed the business operation to the current time for users who performed only one business operation among all users; and / or Determine the time length from the time when the user last performed a business operation to the current time, and compare the time length with the repetition period of the user's own business operation execution, and perform secondary classification on users with the same classification score based on the comparison result.
8. The data processing method according to claim 7, characterized in that: The execution time statistics are quantile statistics of the time length from the execution time of the business operation to the current time for users who only execute the business operation once among all users.
9. The data processing method according to claim 1, wherein: The business operation is an order transaction behavior, and the preset data features include at least one of the total transaction amount, order quantity, purchase cycle, and the number of categories penetrated by cross-category orders.
10. A data processing device, characterized in that: The data processing device includes: An acquisition unit configured to acquire historical behavior data samples of multiple users performing business operations; a sorting unit configured to sort the feature values of the preset data features based on the preset data features in the historical behavior data sample according to the number of users corresponding to the feature values of the preset data features, so as to obtain a feature data set; a stratification unit configured to stratify the feature data set based on information about changes in the number of users corresponding to different feature values of the preset data feature, and obtain stratification information for each user, wherein the stratification information indicates which stratum of the feature data set the user belongs to; The classification unit is configured to classify each user based on the hierarchical information of each user, The preset data feature is a continuous variable feature, which refers to a data feature with a characteristic value of any value. The stratification unit is further configured to: divide the feature data set into a preset number of layers according to a first preset condition, The stratification unit is further configured to: perform a primary stratification on the feature data set according to the first preset condition to obtain a stratified data set; perform a secondary stratification on the data set with the largest information entropy in the stratified data set according to the first preset condition to obtain a secondary stratified data set; perform stratification on the data set with the largest non-information entropy after the primary stratification and the data set with the largest information entropy in the secondary stratified data set according to the first preset condition, until the feature data set is divided into the preset number of layers. The first preset condition is: stratifying the data set with the largest current information entropy into two data sets so that the information gain between the data set before stratification and the two data sets after stratification is maximized, wherein the information gain is determined based on the difference between the information entropy of the data set before stratification and the sum of the information entropy of the two data sets after stratification, and the information entropy is determined based on the eigenvalue and the number of users corresponding to the eigenvalue. Alternatively, the preset data feature is a discrete variable feature, which refers to a data feature having a characteristic value obtained in a counting manner, and the stratification unit is further configured to: divide the feature data set into a preset number of layers according to a second preset condition, The second preset condition includes: determining the first change rate between the number of users of the adjacent first data sample and the second data sample in the feature data set according to the arrangement order of the feature data set, and when the first change rate is greater than a first preset threshold, dividing the first data sample and the second data sample into data sets of different layers; when the first change rate is less than or equal to the first preset threshold, dividing the first data sample and the second data sample into data sets of the same layer.
11. The data processing device according to claim 10, characterized in that The information gain is determined by the following expression: in, Represents the dataset before stratification D The information entropy of and Respectively represent the characteristic values of the preset data features The first and second data sets are divided into two layers. and Respectively represent the information entropy of the first data set and the second data set, the operator represents the number of samples in the set, in, , ,in, Represents data samples k The characteristic value of the preset data characteristic, in, ,in, Representation dataset D The number of characteristic values of the preset data characteristics in Indicates the j The number of users corresponding to the feature value accounts for the D The proportion of the total number of users in in, ,in, Represents the first data set The number of characteristic values of the preset data characteristics in Indicates the i The number of users corresponding to the characteristic values accounts for the first data set The proportion of the total number of users in in, ,in, Represents the second data set The number of characteristic values of the preset data characteristics in Indicates the l The number of users corresponding to the feature value accounts for the second data set The ratio of the total number of users in .
12. The data processing device according to claim 10, characterized in that The second preset condition also includes: When the first change rate is less than or equal to the first preset threshold, determining a second change rate between the number of users of the second data sample and a third data sample adjacent to the second data sample; when the second change rate is greater than the first preset threshold, dividing the second data sample and the third data sample into data sets of different layers; When the second change rate is less than or equal to the first preset threshold, determining a third change rate between the number of users of the third data sample and the first data sample, and when the third change rate is greater than the second preset threshold, dividing the second data sample and the third data sample into different data sets; When the third change rate is less than or equal to a second preset threshold, the first data sample, the second data sample, and the third data sample are divided into data sets of the same layer.
13. The data processing device according to any one of claims 10 to 12, characterized in that: The preset data feature is a plurality of preset data features, Wherein, the classification unit is further configured to: Determine the information entropy of each preset data feature based on the hierarchical information of each user; Comparing the information entropy between the plurality of preset data features to determine a weight value for each preset data feature; Based on the weight value and the hierarchical information of each user, a classification score of each user is determined to classify each user according to the classification score.
14. The data processing device according to claim 13, characterized in that The classification unit is further configured to: Based on the hierarchical information, determining the layer to which each user belongs under each preset data feature; Based on the weight value of each preset data feature, the layer to which each user belongs under each preset data feature is weighted and summed to determine the classification score of each user.
15. The data processing device according to claim 10, characterized in that The classification unit is further configured to: Users with the same classification score are reclassified based on the time when the users perform business operations.
16. The data processing device according to claim 15, characterized in that The classification unit is further configured to: Determine the length of time from the time the user last performed a business operation to the current time, compare the length of time with the execution time statistics, and perform secondary classification on users with the same classification score based on the comparison results, wherein the execution time statistics refer to the statistics of the length of time from the time the user performed the business operation to the current time for users who performed only one business operation among all users; and / or Determine the time length from the time when the user last performed a business operation to the current time, and compare the time length with the repetition period of the user's own business operation execution, and perform secondary classification on users with the same classification score based on the comparison result.
17. The data processing device according to claim 16, characterized in that The execution time statistics are quantile statistics of the time length from the execution time of the business operation to the current time for users who only execute the business operation once among all users.
18. The data processing device according to claim 10, characterized in that The business operation is an order transaction behavior, and the preset data features include at least one of the total transaction amount, order quantity, purchase cycle, and the number of categories penetrated by cross-category orders.
19. An electronic device, characterized in that: The electronic device comprises: processor; A memory storing a computer program, wherein when the computer program is executed by a processor, the data processing method according to any one of claims 1 to 9 is implemented.
20. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Information recommendation method and device
CN106251174A
A power industrial control attack classification method and system based on machine learning
CN109446635A
Content resource pushing determination method and related device
CN112422696A