Bucket dividing method and device for user
By employing a greedy search and multi-round iterative adjustment of the split point, the problem of uneven user bucketing results was solved, resulting in more uniform bucketing and improving the performance of downstream tasks and the accuracy of business decisions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, the number of users in each bucket is uneven, which affects the performance of downstream tasks and makes it difficult to achieve uniform bucket distribution through manual adjustment.
A greedy search method is adopted, which measures the dispersion between buckets by setting an objective function and performing multiple rounds of iteration to adjust the split points of each attribute dimension in order to achieve uniformity of user bucketing results.
This improved the uniformity of user bucketing results, thereby enhancing the performance of downstream tasks and the accuracy of business decisions.
Smart Images

Figure CN121996845A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of data processing, and more particularly to a method and apparatus for user bucketing. Background Technology
[0002] With the rapid development of internet services and digital platforms, the scale and dimensions of user data are growing exponentially. Efficiently understanding user characteristics has become crucial for improving user experience. User profiling technology, as an important means of user modeling, integrates user attributes to construct structured user representations, providing fundamental support for downstream applications such as personalized recommendations, precision marketing, and risk control.
[0003] To further improve processing efficiency and strategy interpretability, user groups are typically binned, grouping users with similar characteristics or behavioral patterns into the same category (i.e., "buckets"), thereby implementing a unified strategy or model at the group level. However, in related technologies, the number of users in each bucket is often uneven, which affects the performance of downstream tasks. Therefore, a method is needed to improve the uniformity of user binning results. Summary of the Invention
[0004] This specification describes one or more embodiments of a user binning method and apparatus to improve the uniformity of user binning results.
[0005] Firstly, a user bucketing method is provided, including multiple iterations, where each iteration includes:
[0006] Obtain the current segmentation point and corresponding current segmentation interval combination for each of the user's multiple attribute dimensions; the multiple attribute dimensions are selected from one or more of the following: frequency-based attributes, activity-based attributes, consumption-based attributes, and interaction-based attributes;
[0007] For any first segmentation point in the current segmentation points of the first attribute dimension, search for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then update the first segmentation point to the first candidate point; the optimization conditions include that after re-segmenting the target user group according to the updated segmentation interval combination determined based on the first candidate point, the value of the objective function decreases; the objective function is used to measure the dispersion of the number of users among multiple buckets.
[0008] In some possible implementations, when any one round is the first round, obtaining the current segmentation points for each of the user's multiple attribute dimensions includes:
[0009] For any attribute dimension, equal-frequency partitioning is performed to obtain multiple candidate points; the equal-frequency partitioning ensures that each interval contains the same number of users.
[0010] Select several candidate points from multiple candidate points in this attribute dimension as the current split points.
[0011] In some possible implementations, selecting several candidate points from multiple candidate points in the attribute dimension as the current segmentation point includes:
[0012] Randomly select several candidate points from the plurality of candidate points as the current segmentation points; or,
[0013] Several candidate points are evenly selected from the plurality of candidate points as the current segmentation points.
[0014] In some possible implementations, the target range of the first segmentation point includes each candidate point between the previous and next segmentation points in a sequence sorted according to the point value of the current segmentation point.
[0015] In some possible implementations, the target range of the first segmentation point includes each candidate point between the previous segmentation point and the next segmentation point, and whose distance from the first segmentation point does not exceed k candidate points.
[0016] In some possible implementations, the step of re-bucketing the target user group according to the updated segmentation interval combination determined based on the first candidate point includes:
[0017] Replace the first split point with the first candidate point and update the combination of split intervals for the first attribute dimension;
[0018] Based on the Cartesian product of the combinations of the segmentation intervals of each attribute dimension, multiple buckets are determined, and each user in the target user group is assigned to the corresponding bucket.
[0019] In some possible implementations, the objective function includes any of the following: the standard deviation of the number of users in each bucket, the quotient of the standard deviation and the mean of the number of users in each bucket, and the mean absolute error of the number of users in each bucket.
[0020] In some possible implementations, the optimization condition further includes: the number of users in any bucket after the re-bucketing operation is greater than a first threshold and less than a second threshold.
[0021] In some possible implementations, the optimization conditions further include: the number of users in any bucket after the re-bucketing operation is greater than a first threshold, and the proportion of buckets with a number of users greater than a second threshold does not exceed a first proportion.
[0022] In some possible implementations, the optimization condition further includes: the proportion of buckets with fewer than a third threshold number of users after the bucketing operation is re-performed does not exceed a second proportion.
[0023] In some possible implementations, the optimization condition further includes: the number of non-empty buckets after the bucket re-division operation is greater than the first number.
[0024] In some possible implementations, each iteration further includes:
[0025] For the second segmentation point among the current segmentation points of the first attribute dimension, search for candidate points within the second target range of the second segmentation point;
[0026] If a combination of first and second candidate points that meets the optimization criteria is found, the first split point is updated to the first candidate point, and the second split point is updated to the second candidate point.
[0027] In some possible implementations, in a sequence sorted by the value of the current segmentation point, the segmentation point preceding the second segmentation point is the first segmentation point, and the segmentation point following the second segmentation point is the third segmentation point; the second target range of the second segmentation point includes each candidate point between the temporary value point of the first segmentation point in this search and the third segmentation point.
[0028] In some possible implementations, in a sequence sorted by the value of the current segmentation point, the segmentation point preceding the second segmentation point is the fourth segmentation point, and the segmentation point following the second segmentation point is the first segmentation point; the second target range of the second segmentation point includes each candidate point between the temporary value point of the first segmentation point in this search and the fourth segmentation point.
[0029] Secondly, a user-defined bucketing device is provided for multi-round iterations, including:
[0030] The acquisition unit is configured to acquire the current segmentation point and the corresponding current segmentation interval combination for each of multiple attribute dimensions of the user; the multiple attribute dimensions are selected from one or more of the following: frequency-based attributes, activity-based attributes, consumption-based attributes, and interaction-based attributes;
[0031] The search unit is configured to, for any first segmentation point in the current segmentation point of any first attribute dimension, search for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then the first segmentation point is updated to the first candidate point; the optimization conditions include that after re-bucketing the target user group according to the updated segmentation interval combination determined based on the first candidate point, the value of the objective function decreases; the objective function is used to measure the dispersion of the number of users among multiple buckets.
[0032] Thirdly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of the first aspect.
[0033] Fourthly, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method of the first aspect.
[0034] The user bucketing method and apparatus proposed in the embodiments of this specification use an objective function to measure the degree of dispersion between buckets as an optimization condition. Based on greedy search, the method searches for attribute dimension split points in the corresponding search space that can reduce the value of the objective function, and performs multiple rounds of split point search and update, so that the number of users in each bucket tends to be uniform after multiple rounds of updates. Attached Figure Description
[0035] To more clearly illustrate the technical solutions of the various embodiments disclosed in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only a few embodiments disclosed in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 This diagram illustrates the user bucketing results in related technologies.
[0037] Figure 2 This illustration shows a scenario of user bucketing according to one embodiment;
[0038] Figure 3 A flowchart illustrating a user bucketing method according to one embodiment is shown;
[0039] Figure 4 A schematic diagram illustrating the search range for any segmentation point according to one embodiment;
[0040] Figure 5 A schematic diagram illustrating the search range for an arbitrary dividing point according to another embodiment;
[0041] Figure 6 A schematic diagram illustrating the search range of the second segmentation point according to one embodiment;
[0042] Figure 7 A schematic diagram showing the search range of the second segmentation point according to another embodiment;
[0043] Figure 8 A schematic block diagram of a user bucketing device according to one embodiment is shown. Detailed Implementation
[0044] The solution provided in this specification will now be described with reference to the accompanying drawings.
[0045] As mentioned earlier, user segmentation based on user profiles is the process of categorizing and dividing user groups with similar characteristics, a key step in refined operations. By segmenting users, businesses or platforms can implement differentiated marketing strategies, product recommendations, content distribution, or customer service for users within different segments, thereby effectively improving user experience and business conversion efficiency.
[0046] User bucketing is the process of classifying user groups according to one or more attribute dimensions (hereinafter referred to as attributes). An attribute dimension can be a discrete-valued attribute, such as the type of client a user uses (web page, mini-program, APP, etc.), or a continuous-valued attribute, such as a user's online time. The specific process of user bucketing is to divide the value range of each attribute dimension into multiple subsets (discrete-valued attributes can be discrete subsets, and continuous-valued attributes can be sub-intervals), and then generate a combination of multiple subsets based on the Cartesian product of the subsets contained in each attribute dimension, which serves as a bucket. Users whose attribute dimensions all conform to the subset corresponding to a certain bucket are assigned to that bucket. The Cartesian product of N sets refers to the set of all possible ordered pairs in the N sets, where any ordered pair contains N elements, and the i-th element comes from the i-th set, i=1,2,…,N.
[0047] For example, suppose we consider three attribute dimensions of the target user group: attribute A, attribute B, and attribute C. We divide the value range of attribute A into subsets a1 and a2, the value range of attribute B into subsets b1, b2, and b3, and the value range of attribute C into subsets c1 and c2. Then, by performing a Cartesian product on the three attribute dimensions, we obtain 2*3*2=12 buckets, namely (a1,b1,c1), (a1,b1,c2), (a1,b2,c1), (a1,b2,c2), (a1,b3,c1), (a1,b3,c2), (a2,b1,c1), (a2,b1,c2), (a2,b2,c1), (a2,b2,c2), (a2,b3,c1), (a2,b3,c2).
[0048] Then, users whose specific values for all three attribute dimensions match a certain bucket are assigned to that bucket. For example, if a user's specific value for attribute A belongs to subset a1, the specific value for attribute B belongs to subset b2, and the specific value for attribute C belongs to subset c2, then the user is assigned to bucket (a1, b2, c2).
[0049] In the process of assigning a user to a bucket, the subsets of each attribute dimension within that bucket can be viewed as individual conditional statements, with the logical relationship between these conditions being "logical AND". Therefore, it's difficult to determine a suitable partitioning method that ensures a relatively even distribution of users across the buckets when partitioning each attribute dimension (creating subsets). Even if a uniform partitioning is achieved when partitioning a single attribute dimension (creating subsets), combining these subsets using the logical AND relationship will still result in a highly uneven distribution of users across the buckets. A few buckets will contain the majority of users, while many buckets will have very few users, for example... Figure 1 As shown.
[0050] Furthermore, if adjustments are made to the already divided buckets, each adjustment will affect multiple buckets, and the relationship between the adjustment scale and the change in the number of people in each bucket cannot be determined in advance. Specifically, assuming there are N buckets in total, and the attribute dimension to be adjusted contains q subsets, then adjusting the position of a split point in that attribute dimension will affect approximately N*2 / q buckets and the number of people in each bucket.
[0051] Continuing with the example above, suppose we find that there are too many people in bucket (a1, b3, c2), and we want to reduce the size of subset b3 to decrease the number of people with attribute B falling into b3, thereby reducing the number of people in bucket (a1, b3, c2), for example, by reducing b3 to b3'. Then, the subset b2, which was originally adjacent to b3, will also change, increasing to b2'. Therefore, any bucket containing b2 or b3 and the number of people in that bucket will change accordingly, specifically affecting the eight buckets: (a1, b2, c1), (a1, b2, c2), (a1, b3, c1), (a1, b3, c2), (a2, b2, c1), (a2, b2, c2), (a2, b3, c1), and (a2, b3, c2). The relationship between the changes in the number of people in these eight buckets and the adjustment scale of b2 and b3 is difficult to determine in advance.
[0052] Manual adjustments typically require repeated trials, and even if these buckets are adjusted to be relatively uniform, some buckets within these relatively uniform buckets will still be affected when adjusting other dimensions. For example, if you want to adjust the size between b1 and b2 later, the four buckets (a1,b2,c1), (a1,b2,c2), (a2,b2,c1), and (a2,b2,c2) out of the aforementioned eight buckets will continue to change. Furthermore, when the dimensionality is too high, the adjustable dimensions and adjustable scales increase exponentially, sometimes even becoming impossible to adjust manually.
[0053] Based on the above analysis, it is evident that during the attribute dimension segmentation stage before bucketing, it is difficult to predetermine suitable split points to achieve uniform bucketing; similarly, when adjusting unevenly distributed buckets, it is difficult to predetermine the adjustment scale. Applying uneven bucketing results to downstream tasks will severely impact their performance, leading to model overfitting, poor generalization ability, and ultimately, biased business decisions and a negative impact on user experience.
[0054] Based on the above analysis, this specification proposes a user bucketing method that uses a greedy search to adjust the values of the split points for each attribute dimension, thereby overcoming the above problems and improving the uniformity of the bucketing results.
[0055] Figure 2 This diagram illustrates a scenario of user bucketing according to one embodiment. Figure 2 As shown, the goal is to bucket a target user group based on n (n>1) attribute dimensions. Theoretically, the attribute dimensions used for bucketing can be either discrete or continuous. When an attribute dimension is discrete, it can be divided into multiple discrete subsets containing the attribute values of that dimension. The division of that attribute dimension can be adjusted by moving a first attribute value from one discrete subset to another. However, in practical business scenarios, it is often difficult to achieve equal-frequency partitioning (the same number of users in each sub-interval) for discrete attribute dimensions, and such partitioning may not necessarily have practical business implications.
[0056] Therefore, in the following sections of this specification, the embodiments mainly consider the division and adjustment of continuous value attribute dimensions. However, if you want to divide and adjust discrete value attribute dimensions, you can also achieve a similar processing result as continuous value attribute dimensions by moving an attribute value from one discrete subset to another discrete subset.
[0057] Figure 2 Each attribute dimension shown is a continuously valued attribute dimension. For any attribute i, it corresponds to a value range (e.g., daily online time corresponds to 0~24 hours), and the goal is to divide it into a preset number of... The segmentation intervals make the number of users in the bucketing results determined based on the segmentation intervals of each attribute more even.
[0058] First, the range of values for attribute i is divided into equal-frequency segments, resulting in... The system is divided into several intervals, such that the number of users in each interval is the same. (In practical applications, it may not be possible to achieve an exact same number of users in each interval. Therefore, in this embodiment, when the difference between the number of users in any two intervals is less than a preset threshold (e.g., 10 or 100, etc.), the number of users in the two intervals is also considered to be the same.) This is a preset multiple. The endpoints of each interval are determined as candidate segmentation points (referred to as candidate points), totaling... One, such as Figure 2 The short tick marks are shown in the diagram. The actual split points in subsequent processes will be selected from these candidate points. Then, the selection will proceed from these. 10 candidate points are used as initial split points, such as... Figure 2 The bold, long tick marks in the image show how each dividing point divides the range of attribute i into segments. A number of segmented intervals.
[0059] At any given time, based on the respective split points of each attribute dimension, the current combination of split intervals for each attribute dimension can be determined. Then, based on the Cartesian product of these split interval combinations, multiple buckets are determined, and each user in the user group is assigned to the corresponding bucket. Figure 2 As shown on the left. Following the aforementioned... Figure 1 In the example, the combination of the dividing intervals of attribute B is (b1, b2, b3).
[0060] It should be noted that, Figure 2 The interval lengths of each attribute dimension, as well as the positions and numbers of each candidate point and split point, are merely illustrative and do not represent a uniform division of dimension values, nor do they constitute a limitation on the scope of protection of the embodiments described in this specification. Figure 2 The number of attribute dimensions shown does not constitute a limitation on the scope of protection of the embodiments described herein.
[0061] Then, the values of the split points for each attribute dimension are iteratively adjusted in multiple rounds to achieve a more uniform bucketing result. In any iteration, an attribute j to be adjusted and a current split point on attribute j are selected. At the dividing point Search for nearby candidate points. If a candidate point is found... This makes the candidate points Replace the dividing point After re-dividing attribute j and then re-bucketing users based on the re-divided attribute j, the number of users in each new bucket is more evenly distributed compared to before. Therefore, the split point is... The value is updated as a candidate point. The system then re-buckets the data based on the updated split points, ending the current iteration. If no suitable candidate point is found within the search range, the iteration also ends.
[0062] How to determine the dividing point The search range and how to measure the uniformity of binning will be described in detail later in this manual.
[0063] The process described above is repeated multiple times. When a preset stopping condition is met, the iteration ends, and the current bucketing result is output. The stopping condition can be that the number of iterations reaches a preset upper limit, or that the uniformity of the bucketing reaches a preset average value.
[0064] The following describes the specific implementation steps of the above-mentioned user bucketing method with reference to specific embodiments.
[0065] Figure 3 A flowchart illustrating a user bucketing method according to one embodiment is provided. The entity executing the method can be any platform, server, or device cluster with computing and processing capabilities. Figure 3 As shown, the method includes multiple iterations, wherein any iteration includes at least the following steps: Step S302, obtaining the current segmentation point and the corresponding current segmentation interval combination for each of the user's multiple attribute dimensions; Step S304, for the first segmentation point among the current segmentation points of any first attribute dimension, searching for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then the first segmentation point is updated to the first candidate point.
[0066] The specific execution process of each of the above steps is described below.
[0067] First, in step S302, the current segmentation point and the corresponding current segmentation interval combination of each of the user's multiple attribute dimensions are obtained; the multiple attribute dimensions are selected from one or more of the following: frequency-type attributes, activity-type attributes, consumption-type attributes, and interaction-type attributes.
[0068] In practical applications, user groups are typically segmented based on specific business needs, using appropriate attribute dimensions. For example, in personalized recommendations and precision marketing, frequency-based, activity-based, consumption-based, and interaction-based attributes are often selected to more accurately construct user profiles in downstream tasks and enable corresponding content / product / friend recommendations or marketing. Frequency-based attributes include, for example, average daily logins, average daily product views, and the number of orders placed in the last 30 days; activity-based attributes include, for example, average daily usage time and percentage of active days; consumption-based attributes include, for example, the number of historical orders, average order value, and repurchase rate; and interaction-based attributes include, for example, the number of ratings, reviews, and frequency of participation in activities. Similarly, in risk control scenarios, frequency-based and behavioral attributes can be selected, with behavioral attributes including, for example, page dwell time and operation speed.
[0069] The attribute dimensions selected in step S302 are typically continuous-value attributes as described above. At the beginning of this iteration, the current segmentation point of each attribute dimension is obtained through step S302, and based on the current segmentation points of any attribute dimension, the value range of that attribute dimension is divided into multiple segmentation intervals to determine the current combination of segmentation intervals for that attribute dimension.
[0070] Furthermore, based on the Cartesian product of the segmentation intervals of each attribute dimension, the target user group can be divided into multiple buckets, and each user can be assigned to the corresponding bucket to determine the current bucketing result.
[0071] In one embodiment, if the current round is not the first round, but any round from the second round onwards, the segmentation point value at the end of the previous round can be used to continue the iteration and update of this round. In this embodiment, step S302 specifically includes: obtaining the segmentation points of each of the user's multiple attribute dimensions at the end of the previous iteration, and using them as the current segmentation point.
[0072] In another embodiment, the current round is the first round, and initialization operations need to be performed on the respective split points of each attribute dimension. In this embodiment, step S302 specifically includes steps 11 and 12.
[0073] In step 11, equal-frequency partitioning is performed for any attribute dimension to obtain multiple candidate points; the equal-frequency partitioning ensures that each interval contains the same number of users.
[0074] Candidate points are the endpoints of each interval obtained by equal-frequency division. The number of intervals for equal-frequency division can be preset according to specific business needs. Correspondingly, the number of candidate points is also preset (the number of intervals - 1).
[0075] For any attribute dimension, dividing the total number of users in the target user group by the number of preset intervals for that attribute dimension yields the number of users (e.g., r) in each interval. Then, based on the distribution of the target user group along that attribute dimension, we can move from one side of the corresponding value interval towards the other, and set a candidate point every r users counted, thus achieving equal-frequency partitioning of that attribute dimension. The values of these candidate points remain unchanged in subsequent iterations.
[0076] Then, in step 12, several candidate points are selected from the multiple candidate points in this attribute dimension as the current segmentation points.
[0077] The number of split points can be preset according to specific business needs. In step 12, split points can be selected from candidate points in various ways. For example, several candidate points can be randomly selected from multiple candidate points as the current split points; or, several candidate points can be evenly selected from multiple candidate points as the current split points.
[0078] It is understandable that since the split points are selected from the candidate points, the number of split points for any attribute dimension is necessarily less than the number of corresponding candidate points. Furthermore, in order to expand the overall search range in step S304, the number of candidate points is usually several times the number of split points.
[0079] After obtaining the respective split points for each attribute dimension in step S302, it is necessary to adjust the values of the split points to make the number of users in each bucket more uniform.
[0080] Therefore, in step S304, for the first segmentation point among the current segmentation points of any first attribute dimension, candidate points are searched within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, the first segmentation point is updated to the first candidate point.
[0081] The first attribute dimension is one of multiple attribute dimensions. The first attribute dimension can be randomly selected from multiple attribute dimensions, or it can be a sequence of multiple attribute dimensions that are sorted in a certain order and processed in each iteration round according to that sorting order. The first attribute dimension is the attribute dimension that is rotated to be processed in the current iteration round.
[0082] The first split point can be any split point selected from the current split points of the first attribute dimension. Candidate points are searched within the target range near the first split point, and the first candidate point is used to replace the first split point to re-divide the first attribute dimension, resulting in a new combination of split intervals for the first attribute dimension. Then, based on the new combination of split intervals for the first attribute dimension, a Cartesian product is performed with the current combination of split intervals for each of the other attribute dimensions to obtain a new bucketing result. Users in the target user group are then assigned to the new buckets. If the re-bucketing result meets the preset optimization conditions, i.e., at least makes the number of users more evenly distributed across the buckets, the value of the first split point is updated to the first candidate point, and the current iteration ends, proceeding to the next iteration.
[0083] If none of the candidate points within the target range near the first split point meet the preset optimization conditions, then keep the value of the first split point unchanged, end the current iteration, and proceed to the next iteration.
[0084] After multiple iterations and reaching a preset stopping condition, the iteration can end, and the binning results at the end of the last iteration can be output. The stopping condition can be that the number of iterations reaches a preset upper limit, or that the uniformity of the binning reaches a preset average value, which corresponds to the specific value of the objective function in subsequent steps.
[0085] The following section first describes in detail how the target range corresponding to the first segmentation point is determined, and then describes in detail the specific content of the optimization conditions.
[0086] In the following text, for a given split point, the preceding split point in the sequence sorted by its value is intuitively called the left split point, and the following split point is intuitively called the right split point. Thus, when moving the first split point for searching, the first split point cannot overlap with any split points to its left or right, or coincide with any of the split points to its left or right.
[0087] Therefore, in one embodiment, the target range of the first segmentation point includes all candidate points between the left and right segmentation points of the first segmentation point, such as... Figure 4 As shown. In Figure 4 In the diagram, the shorter tick marks represent candidate points, while the bolder, longer tick marks represent the current segmentation point. The first segmentation point could be... Figure 4 In the diagram, the left dividing point can be dividing point 2, and the right dividing point can be dividing point 3. Therefore, the target range of the first dividing point is as follows: Figure 4 The search range is shown in the figure.
[0088] In this embodiment, the restriction is only that the first segmentation point cannot cross other segmentation points or overlap with other segmentation points. When the first segmentation point is far away from the segmentation points on the left and right sides, the number of candidate points contained in its corresponding target range will be too large. This will not only increase the computational cost of a single iteration, but also make it easier to get trapped in a local solution.
[0089] Therefore, in a more specific embodiment, the maximum search distance in a single iteration is also limited. In this embodiment, the target range of the first split point includes all candidate points between the left and right split points, and whose distance from the first split point does not exceed k candidate points.
[0090] When the distance between the left dividing point and the first dividing point exceeds k candidate points, the left boundary of the target range is the kth candidate point to the left of the first dividing point; when the distance between the left dividing point and the first dividing point does not exceed k candidate points, the left boundary of the target range is the 1st dividing point to the right of the left dividing point.
[0091] When the distance between the right segmentation point and the first segmentation point exceeds k candidate points, the right boundary of the target range is the kth candidate point to the right of the first segmentation point; when the distance between the right segmentation point and the first segmentation point does not exceed k candidate points, the right boundary of the target range is the 1st segmentation point to the left of the right segmentation point.
[0092] The target range corresponding to each combination of the left and right boundaries is as follows: Figure 5 As shown. In Figure 5 In the example, assuming k=3, the first dividing point could be... Figure 5 Dividing point 1 in the diagram. When the left dividing point is dividing point 2 and the right dividing point is dividing point 3, the target range is as follows: Figure 5 The range is shown in the first curly brace below the coordinate axis; when the left dividing point is dividing point 2 and the right dividing point is dividing point 3', the target range is as follows. Figure 5 The range is shown in the second curly brace below the coordinate axis; when the left dividing point is dividing point 2' and the right dividing point is dividing point 3, the target range is as follows. Figure 5 The range is shown in the third curly brace below the coordinate axis; when the left dividing point is dividing point 2' and the right dividing point is dividing point 3', the target range is as follows. Figure 5 The range shown is indicated by the fourth curly brace below the coordinate axis.
[0093] Considering all the above situations, let's assume the first dividing point is the [number]th ... The candidate point, whose left-hand dividing point is the nth point from left to right. The candidate point, whose right-hand dividing point is the first one from left to right. There are candidate points. The target range of the first segmentation point can then be represented as: .
[0094] In other embodiments, other target ranges can be set. For example, the target range of the first segmentation point can be set to the candidate points adjacent to it on the left and right sides to reduce the search space and speed up the search and iteration.
[0095] The above describes the target range of the first segmentation point. The following describes the optimization conditions that must be met when searching for candidate points within the target range.
[0096] First, an objective function is defined to measure the dispersion of the number of users among multiple buckets. Correspondingly, the optimization conditions include that after re-bucking the target user group according to the updated segmentation interval combination determined by replacing the first split point with the first candidate point, the value of the objective function decreases, meaning the dispersion of the number of users among the buckets becomes smaller.
[0097] Various objective functions can be set to measure the dispersion of the number of users in a bucket.
[0098] In one embodiment, the objective function includes any of the following: the standard deviation of the number of users in each bucket, the quotient of the standard deviation and the mean of the number of users in each bucket, and the mean absolute error of the number of users in each bucket.
[0099] Considering only non-empty buckets (empty buckets can be omitted from downstream tasks, so we only consider the dispersion between non-empty buckets here), assuming there are a total of There are 1 non-empty bucket, and the number of users in each bucket is as follows: When the objective function When the standard deviation of the number of users in each bucket is given, it is as shown in formula (1):
[0100]
[0101] When the objective function When the quotient of the standard deviation and the mean of the number of users in each bucket is given by formula (2):
[0102]
[0103] When the objective function When the average absolute error of the number of users in each bucket is given, it is as shown in formula (3):
[0104]
[0105] In other embodiments, other forms of objective functions can be set according to specific needs, as long as they can measure the dispersion of the number of users between buckets, which is not limited here.
[0106] The above describes the specific form of the objective function, and the optimization conditions must at least include reducing the value of the objective function. In other embodiments, additional conditions can be added to the optimization conditions to narrow the overall search space and further improve search efficiency.
[0107] In one embodiment, the optimization condition further includes: the number of users in any bucket after the re-bucketing operation is greater than a first threshold. And less than the second threshold .
[0108] In another embodiment, since users tend to cluster in a few buckets, a soft constraint can be considered. In this embodiment, the optimization condition further includes: the number of users in any bucket after the re-bucketing operation is greater than a first threshold. And the number of users is greater than the second threshold. The number of buckets does not exceed the first proportion. .
[0109] Unlike the previous embodiment, this embodiment does not strictly limit the number of users in all buckets to not exceed the second threshold. Instead, it was changed to limit the value to be greater than the second threshold. The proportion of buckets is adjusted to achieve soft constraints.
[0110] Furthermore, based on the constraint of limiting the number of users in the aforementioned buckets, in one embodiment, the optimization condition further includes: the number of users after the bucketing operation is re-performed is less than a third threshold. The number of buckets does not exceed the second proportion. .
[0111] This constraint allows us to reduce the number of buckets with fewer users in the early stages of iteration, making the number of users more evenly distributed across the buckets.
[0112] In other embodiments, in addition to limiting the number of users in a bucket as described above, the number of non-empty buckets in the bucketing result can also be limited. Accordingly, the optimization condition also includes: the number of non-empty buckets after the bucketing operation is re-performed is greater than a first number. .
[0113] Since the objective function can only constrain the evenness of users among non-empty buckets, but not the number of non-empty buckets, limiting the number of non-empty buckets can prevent the bucketing results from being too concentrated in a few buckets.
[0114] The above describes the specific constraints that can be included in the optimization conditions. These constraints can make the number of users in each non-empty bucket more even, and can also reduce the search space and improve search efficiency during the search.
[0115] Steps S302 and S304 above describe the specific steps for searching based on a split point in a single iteration.
[0116] In some possible implementations, the number of split points searched simultaneously in a single round can be increased to broaden the search space.
[0117] In this embodiment, based on steps S302 and S304, any iteration also includes steps 21 and 22.
[0118] In step 21, for the second segmentation point among the current segmentation points of the first attribute dimension, candidate points are searched within the second target range of the second segmentation point.
[0119] The second target range of the second segmentation point can be determined based on the prior search of candidate points corresponding to the first segmentation point.
[0120] In one embodiment, the segmentation point to the left of the second segmentation point is the first segmentation point, and the segmentation point to the right of the second segmentation point is the third segmentation point; the second target range of the second segmentation point includes all candidate points between the temporary value point of the first segmentation point in this search and the third segmentation point, such as... Figure 6 As shown. In Figure 6 In the diagram, the dashed scale line represents the original position of the first dividing point (dividing point 1), while the bold scale line represents the temporary value of the first dividing point in this search.
[0121] In another embodiment, the segmentation point to the left of the second segmentation point is the fourth segmentation point, and the segmentation point to the right of the second segmentation point is the first segmentation point; the second target range of the second segmentation point includes all candidate points between the temporary value point of the first segmentation point in this search and the fourth segmentation point, such as... Figure 7 As shown. In Figure 7 In the diagram, the dashed scale line represents the original position of the first dividing point (dividing point 1), while the bold scale line represents the temporary value of the first dividing point in this search.
[0122] In some more specific embodiments, based on the above-mentioned second target range, the second target range can be further limited to no more than p division points to the left and right of the second division point. For details, please refer to the above description of the first division point, which will not be repeated here.
[0123] Then, in step 22, if a combination of the first candidate point and the second candidate point that meets the optimization conditions is found, the first split point is updated to the first candidate point and the second split point is updated to the second candidate point.
[0124] If a combination of two candidate points can be found that replaces the first split point with the first candidate point and the second split point with the second candidate point, the first attribute dimension is re-divided to obtain a new combination of split intervals for the first attribute dimension. Then, based on the new combination of split intervals for the first attribute dimension, a Cartesian product is performed with the current combination of split intervals for each of the other attribute dimensions to obtain a new bucketing result. Users in the target user group are then assigned to the new buckets. If the re-bucketing result meets the preset optimization conditions, the first split point is updated to the first candidate point, and the second split point is updated to the second candidate point. The current iteration ends, and the next iteration begins.
[0125] If none of the combinations of candidate points within the target range of the first and second split points can satisfy the preset optimization conditions, then the values of the first and second split points remain unchanged, the current iteration ends, and the next iteration begins.
[0126] The above describes the specific steps for simultaneously searching two split points based on one attribute dimension in a single iteration. In other implementations, the above steps can be referred to further to increase the number of split points searched simultaneously, such as simultaneously searching three split points under one attribute dimension, which will not be elaborated here.
[0127] The user bucketing method provided in the embodiments of this specification sets an objective function to measure the degree of dispersion between buckets as an optimization condition. Based on greedy search, it searches for attribute dimension split points in the corresponding search space that can reduce the value of the objective function, and performs multiple rounds of split point search and update, so that the number of users in each bucket tends to be uniform after multiple rounds of updates.
[0128] Based on this, corresponding constraints can be set to reduce the search space and improve search efficiency. Alternatively, the number of split points searched simultaneously in a single iteration can be increased to expand the search space.
[0129] According to another embodiment, a device for user-defined buckets is also provided. Figure 8 A schematic block diagram of a user bucketing apparatus according to one embodiment is shown. This apparatus can be deployed in any device, platform, or cluster of devices with computing and processing capabilities. Figure 8 As shown, the device 800 is used for multiple rounds of iteration and includes:
[0130] The acquisition unit 802 is configured to acquire the current segmentation point and the corresponding current segmentation interval combination of each of multiple attribute dimensions of the user; the multiple attribute dimensions are selected from one or more of the following: frequency-type attributes, activity-type attributes, consumption-type attributes, and interaction-type attributes;
[0131] The search unit 804 is configured to, for any first segmentation point in the current segmentation point of any first attribute dimension, search for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then the first segmentation point is updated to the first candidate point; the optimization conditions include, after re-segmenting the target user group according to the updated segmentation interval combination determined based on the first candidate point, the value of the objective function decreases; the objective function is used to measure the dispersion of the number of users among multiple buckets.
[0132] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform the methods described in any of the above embodiments.
[0133] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method described in any of the above embodiments.
[0134] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0135] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0136] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0137] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0138] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A user bucketing method, comprising multiple iterations, wherein any iteration includes: Obtain the current segmentation point and the corresponding current segmentation interval combination for each of the user's multiple attribute dimensions; The multiple attribute dimensions are selected from one or more of the following: frequency-based attributes, activity-based attributes, consumption-based attributes, and interaction-based attributes; For any first segmentation point in the current segmentation points of the first attribute dimension, search for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then update the first segmentation point to the first candidate point; the optimization conditions include that after re-segmenting the target user group according to the updated segmentation interval combination determined based on the first candidate point, the value of the objective function decreases; the objective function is used to measure the dispersion of the number of users among multiple buckets.
2. The method according to claim 1, wherein, When any of the rounds is the first round, obtaining the current segmentation points for each of the user's multiple attribute dimensions includes: For any attribute dimension, equal-frequency partitioning is performed to obtain multiple candidate points; the equal-frequency partitioning ensures that each interval contains the same number of users. Select several candidate points from multiple candidate points in this attribute dimension as the current split points.
3. The method according to claim 2, wherein, The step of selecting several candidate points from multiple candidate points in this attribute dimension as the current segmentation point includes: Randomly select several candidate points from the plurality of candidate points as the current segmentation points; or, Several candidate points are evenly selected from the plurality of candidate points as the current segmentation points.
4. The method according to claim 1, wherein, The target range of the first segmentation point includes all candidate points between the previous and next segmentation points in a sequence sorted according to the point value of the current segmentation point.
5. The method according to claim 4, wherein, The target range of the first segmentation point includes all candidate points between the previous segmentation point and the next segmentation point, and whose distance from the first segmentation point does not exceed k candidate points.
6. The method according to claim 1, wherein, The step of re-segmenting the target user group according to the updated segmentation interval combination determined based on the first candidate point includes: Replace the first split point with the first candidate point and update the combination of split intervals for the first attribute dimension; Based on the Cartesian product of the combinations of the segmentation intervals of each attribute dimension, multiple buckets are determined, and each user in the target user group is assigned to the corresponding bucket.
7. The method according to claim 1, wherein, The objective function includes any of the following: the standard deviation of the number of users in each bucket, the quotient of the standard deviation and the mean of the number of users in each bucket, and the mean absolute error of the number of users in each bucket.
8. The method according to claim 1, wherein, The optimization conditions also include: the number of users in any bucket after the bucketing operation is re-performed is greater than the first threshold and less than the second threshold.
9. The method according to claim 1, wherein, The optimization conditions also include: the number of users in any bucket after the re-bucketing operation is greater than the first threshold, and the proportion of buckets with a number of users greater than the second threshold does not exceed the first proportion.
10. The method according to claim 8 or 9, wherein, The optimization conditions also include: the proportion of buckets with fewer than the third threshold number of users after the bucketing operation is re-performed does not exceed the second proportion.
11. The method according to claim 8 or 9, wherein, The optimization conditions also include: the number of non-empty buckets after the bucket re-division operation is greater than the first number.
12. The method according to claim 1, wherein, Each iteration also includes: For the second segmentation point among the current segmentation points of the first attribute dimension, search for candidate points within the second target range of the second segmentation point; If a combination of first and second candidate points that meets the optimization criteria is found, the first split point is updated to the first candidate point, and the second split point is updated to the second candidate point.
13. The method according to claim 12, wherein, In the sequence sorted according to the value of the current split point, the first split point is the previous split point of the second split point, and the third split point is the next split point; the second target range of the second split point includes all candidate points between the temporary value point of the first split point in this search and the third split point.
14. The method according to claim 12, wherein, In the sequence sorted by the value of the current split point, the previous split point of the second split point is the fourth split point, and the next split point is the first split point; the second target range of the second split point includes all candidate points between the temporary value point of the first split point in this search and the fourth split point.
15. A user-based bucketing device for multiple iterations, comprising: The acquisition unit is configured to acquire the current segmentation point and the corresponding current segmentation interval combination for each of the user's multiple attribute dimensions. The multiple attribute dimensions are selected from one or more of the following: frequency-based attributes, activity-based attributes, consumption-based attributes, and interaction-based attributes; The search unit is configured to, for any first segmentation point in the current segmentation point of any first attribute dimension, search for candidate points within the target range of the first segmentation point; if a first candidate point that meets the optimization conditions is found, then the first segmentation point is updated to the first candidate point; the optimization conditions include that after re-bucketing the target user group according to the updated segmentation interval combination determined based on the first candidate point, the value of the objective function decreases; the objective function is used to measure the dispersion of the number of users among multiple buckets.
16. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-14.
17. A computing device comprising a memory and a processor, wherein, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-14.