Training data equalization processing method and device, equipment, medium and product
By generating a set of associated data for bank users, obtaining other users and objects of the same category, and generating new associated data to balance the training samples, the problem of unbalanced distribution of user features is solved, the learning and recognition capabilities of the model are improved, overfitting is reduced, and classification accuracy is enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-10
AI Technical Summary
The uneven distribution of bank user characteristics leads to overfitting of the majority user characteristics, which account for a large proportion, while the model is not good at learning and recognizing the minority user characteristics, which account for a small proportion.
By generating a set of related data, other users and objects of the same category as the target user are obtained, new related data is generated to balance the training samples, and the related data set is used to train the association relationship classification model.
It improves the learning and recognition capabilities of minority user characteristics, reduces model overfitting, and improves model classification accuracy.
Smart Images

Figure CN121834736A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, medium, and product for training data balancing. Background Technology
[0002] With the rapid growth of banking business, the banking user group covers a variety of types, including enterprises and individuals, and the user characteristics have both general commonalities and individual differences.
[0003] In the process of user feature processing, the proportions of user groups with different attributes, behaviors, or needs vary significantly in the data sample, making the imbalance in user data distribution even more pronounced. When building relevant models based on user data, it can lead to the model overfitting the majority of user features that account for a large proportion, while its ability to learn and identify the minority of user features that account for a small proportion is insufficient. Summary of the Invention
[0004] This invention provides a training data balancing processing method, apparatus, device, medium, and product that can balance the training data of a model.
[0005] In a first aspect, embodiments of the present invention provide a training data balancing processing method, the method comprising:
[0006] When a user in the user set is associated with an object in the object set, an association record is generated based on the associated user and object and added to the association data set. The association data set is used to generate training samples, and the training samples are used to train the association relationship classification model.
[0007] Obtain other users of the same category as the target user corresponding to the data to be supplemented in the associated data set;
[0008] Obtain the target object associated with the target user in the associated data set;
[0009] Based on each target object, candidate objects of the target users are determined from other objects associated with each of the other users in the associated data set;
[0010] Association data is generated based on the target user and each of the candidate objects, and added to the association data set so that the association data set generates training samples associated with the target user in a balanced manner.
[0011] Secondly, embodiments of the present invention also provide a training data balancing processing apparatus, the apparatus comprising:
[0012] The association data generation module is used to generate an association data entry based on the associated user and object when a user in the user set is associated with an object in the object set, and add it to the association data set. The association data set is used to generate training samples, and the training samples are used to train the association relationship classification model.
[0013] The same type of user identification module is used to obtain other users of the same category as the target user corresponding to the supplementary data in the associated data set;
[0014] The object association module is used to obtain the target object associated with the target user in the association data set;
[0015] A candidate object determination module is used to determine, based on each target object, candidate objects of the target user among other objects associated with each other user in the associated data set;
[0016] The balanced data supplementation module is used to generate associated data based on the target user and each of the candidate objects, and add it to the associated data set so that the associated data set generates training samples associated with the target user in a balanced manner.
[0017] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the training data balancing processing method as described in any of the embodiments of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the training data balancing processing method as described in any of the embodiments of the present invention.
[0019] Fifthly, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the training data balancing processing method as described in any of the embodiments of the present invention.
[0020] The technical solution of this invention obtains the target user corresponding to the data that needs to be supplemented in the associated data set, and determines the target user's filtering objects from the objects associated with other users of the same type in the associated data set based on the target user's own associated target objects in the associated data set. It adds associated objects to the target user to generate new associated data, which can increase the associated data of the target user and solve the problem of imbalanced training data for user features in the prior art. It can enrich the data of the users that need to be supplemented, and then train the association relationship classification model based on the balanced associated data set. This can improve the learning and recognition ability of the supplemented user data, reduce model overfitting, and improve the model classification accuracy.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart of a training data balancing processing method provided in an embodiment of the present invention;
[0024] Figure 2 A flowchart of another training data balancing processing method provided in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the training data equalization processing device provided in an embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0027] The accompanying drawings illustrate specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0028] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0029] It should be noted that similar reference numerals and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first" and "second" are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. The acquisition, storage, use, and processing of data in the technical solutions of this application comply with relevant national laws and regulations. It should be noted that in the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used the relevant content of such solutions.
[0030] Figure 1 The flowchart of the training data equalization processing method provided in the embodiments of the present invention Figure 1 This embodiment can be applied to the situation where training data for a classification model of user-object relationship association in a banking system needs to be balanced and supplemented. This method can be executed by a training data balancing processing device, which can be implemented in hardware and / or software. For example... Figure 1 As shown, the method includes the following steps:
[0031] S110. When a user in the user set is associated with an object in the object set, a relationship data is generated based on the associated user and object, and added to the relationship data set. The relationship data set is used to generate training samples, and the training samples are used to train the relationship classification model.
[0032] In this context, the user set can refer to the collection of users utilizing the banking system. The object set can refer to objects that users can interact with through the banking system. In some embodiments, objects can refer to functional modules, products, users, devices, services, and resources, etc. Associated data can refer to recorded data of interactions between users and objects. In some embodiments, associated data can be: purchase records of products purchased by users; transaction records between users; user account query functional modules; or user use of financial services. Associated data can also include attributes of the associated users and attributes of the objects. For example, purchase records can include the quantity and type of products.
[0033] The associated dataset is used to generate training samples. In some embodiments, one piece of associated data can generate one training sample. The association classification model takes a user and an object as input and outputs a classification result of the association relationship between the user and the object. The classification result of the association relationship can include: an association relationship exists or no association relationship exists.
[0034] S120. Obtain other users of the same category as the target user corresponding to the data to be supplemented in the associated data set.
[0035] In this context, "data to be supplemented" refers to missing related data in the classification results of the associated data set. The number of related data entries for user categories and object categories in the associated data set can be statistically analyzed, and the missing data to be supplemented for each category can be determined based on the statistical results. The data to be supplemented includes both users and objects; the users included in the supplemented data are the target users. Other users in the same category refer to users in the user set who are similar to the target users.
[0036] S130. Obtain the target object associated with the target user in the associated data set.
[0037] Here, the target object can refer to an object that is associated with the target user within the associated data of the associated data set. The associated data set can contain at least one associated data item that includes the target user; correspondingly, the target user can have at least one target object.
[0038] S140. Based on each target object, determine the candidate objects of the target users among the other objects associated with each other user in the associated data set.
[0039] Candidate objects refer to objects that are highly likely to be associated with the target user. Other objects refer to objects that are associated with other users. These other objects, being objects associated with users similar to the target user, constitute the range of objects that the target user is associated with. The target object is understood as an object that the target user has already associated with. These objects are removed from the range of objects associated with the target user, and the remaining objects can be used as candidate objects. These candidate objects are then combined with the target user to generate supplementary data, increasing the sample data for missing categories.
[0040] S150. Generate association data based on the target user and each of the candidate objects, and add it to the association data set so that the association data set generates training samples associated with the target user in a balanced manner.
[0041] In this process, a single association record is generated for each target user and a candidate object. This generated association record is added to the association data set as supplementary data to fill missing category samples. Attributes of both the target user and the candidate object can also be added to the generated association record.
[0042] The technical solution of this invention obtains the target user corresponding to the data that needs to be supplemented in the associated data set, and determines the target user's filtering objects from the objects associated with other users of the same type in the associated data set based on the target user's own associated target objects in the associated data set. It adds associated objects to the target user to generate new associated data, which can increase the associated data of the target user and solve the problem of imbalanced training data for user features in the prior art. It can enrich the data of the users that need to be supplemented, and then train the association relationship classification model based on the balanced associated data set. This can improve the learning and recognition ability of the supplemented user data, reduce model overfitting, and improve the model classification accuracy.
[0043] In an optional embodiment, determining candidate objects of the target user from other objects associated with each of the other users in the associated data set based on each target object includes: obtaining other objects associated with each of the other users in the associated data set; and filtering out at least one candidate object from each of the other objects whose object category is different from that of each target object.
[0044] In this context, different object categories can mean that other objects are not similar to the target object. Two objects belonging to different object categories indicate that the two objects are not similar.
[0045] For example, the target objects include object 1 and object 2, and other objects include object 1, object 3, and object 4. Object category A includes object 1 and object 3, object category B includes object 2, and object category C includes object 4. The target objects belong to object categories A and B. Object category C is different from object categories A and B. Object category C includes object 4. Therefore, object 4 can be identified as a candidate object.
[0046] It is evident that by filtering out other objects that belong to different categories from the target object and identifying them as candidate objects, a set of effective candidate related data can be generated for users with missing data. This allows for knowledge transfer using rich category-related data, generating reliable related data and improving the comprehensiveness of training data coverage.
[0047] In an optional embodiment, the step of filtering out at least one candidate object from among the other objects that belongs to a different object category than the target object includes: obtaining a first object category to which each of the other objects belongs; obtaining a second object category to which each target object belongs; filtering out a third object category from among the first object categories that is different from each of the second object categories; and for each third object category, determining candidate objects that belong to a different object category from the target object based on other objects belonging to the third object category.
[0048] This allows for clustering of objects within a collection. Clustering can be based on object attributes. When a new object is added to the collection, it can be categorized. If the new object does not belong to an existing object category, the latest collection (the one with the new object) can be re-clustered. The number of other objects, the number of objects in the first object category, the number of the target object, the number of objects in the second object category, and the number of objects in the third object category must all be at least one.
[0049] As can be seen, by comparing the first object category of other objects with the second object category of the target object, a third object category that is different from the second object category can be identified in the first object category. Candidate objects can then be filtered out from other objects in the third object category. This makes the candidate object filtering process clear, controllable, and simple, and can accurately filter candidate objects. It transforms the retrieval of candidate objects associated with the target user into filtering based on the relationship between categories, thereby improving filtering efficiency.
[0050] In an optional embodiment, determining candidate objects belonging to a different object category from each of the target objects based on other objects belonging to the third object category includes: when the number of other objects belonging to the third object category is at least two, selecting one other object belonging to the third object category and determining it as a candidate object belonging to a different object category from each of the target objects.
[0051] Specifically, when there is only one other object belonging to the third object category, this other object is identified as a candidate object belonging to a different object category than the target objects. When there are multiple other objects in the same third object category, the features of the associated data generated by these multiple other objects overlap and are redundant. To reduce the generation of multiple redundant associated data, only one other object in the same third object category is retained as a candidate object. In some embodiments, an other object is randomly selected from the multiple other objects in the same third object category to be identified as a candidate object.
[0052] It is evident that by retaining one of the other objects from the third object category as a candidate object, duplicate candidate objects can be removed, reducing redundant candidate objects. This approach can maintain the diversity and breadth of information coverage of candidate objects while reducing redundancy.
[0053] In an optional embodiment, obtaining other users of the same category as the target user corresponding to the supplementary data in the associated data set includes: clustering each user in the user set according to the associated data set to obtain at least one user category; locating the user category to which the target user belongs; and extracting other users in the user category to which the target user belongs, excluding the target user.
[0054] The associated data records not only the relationships between users and objects, but also the attributes of both users and objects. Users in the user set can be clustered based on these relationships, user attributes, and object attributes to obtain at least one user category. The user categories that include the target user are then identified, and users within those categories other than the target user are designated as other users, essentially the same category as the target user.
[0055] In some embodiments, the user category to which the target user belongs can be determined as the target category, and all users in the target category other than the target user can be considered as other users. Alternatively, at least one user can be randomly selected from all users in the target category other than the target user as other users. Or, at least one user can be selected as other users based on the similarity between all users in the target category other than the target user and the target user; for example, at least one user with higher similarity can be selected, or at least one user with lower similarity can be selected.
[0056] It is evident that by clustering users to obtain user categories, and selecting users from the user categories to which the target user belongs as other users, the semantic relevance and quality of supplementary data can be increased, achieving more accurate oversampling of missing data.
[0057] In an optional embodiment, obtaining other users of the same category as the target user corresponding to the supplementary data in the associated data set includes: counting the number of samples of associated data belonging to the users in the user set in the associated data set; determining the target user corresponding to the supplementary data from each user in the user set based on the number of samples of each user in the user set; and obtaining other users of the same category as the target user.
[0058] The number of user samples can refer to the amount of associated data for that user. The number of samples for each user can be compared to identify at least one user with the smallest sample size, and this user will be considered the target user for whom additional associated data is needed.
[0059] In some embodiments, users whose sample size is less than a preset threshold can be identified as target users. Alternatively, the proportion of sample sizes for each user can be calculated, and at least one user with the smallest proportion can be selected as a target user.
[0060] It is evident that by counting the number of related data entries for each user as the sample size, and then filtering out target users based on the sample size for each user, the number of related data entries for each user can represent the sample gap. This allows for the quantification of data imbalance, accurate identification of data gaps, and precise location of insufficient related data. Furthermore, it enables the identification of target users with insufficient related data, thereby supplementing the related data of target users and mitigating the imbalance in the related dataset.
[0061] Figure 2 The flowchart of the training data equalization processing method provided in the embodiments of the present invention Figure 2 The embodiments of the present invention optimize and improve the method for determining the target data completion strategy based on the above embodiments, such as... Figure 2 As shown, this training data balancing method includes the following steps:
[0062] S210. When a user in the user set is associated with an object in the object set, a relationship data is generated based on the associated user and object, and added to the relationship data set. The relationship data set is used to generate training samples, and the training samples are used to train the relationship classification model.
[0063] S220. Add the user attribute characteristics of the associated users and the object attribute characteristics of the associated objects to the generated association data.
[0064] User attribute features are used to represent user attributes. Object attribute features are used to represent object attributes. User attribute features can be obtained after obtaining explicit authorization from the user regarding attributes. For example, authorization methods such as clearly specifying the scope of attribute collection through pop-up confirmations or checkboxes can be used for user confirmation. After explicit user authorization, the user's direct attribute information can be encrypted to obtain attribute features. If the object is a user, the same method can be used to obtain the user's authorization and obtain the object's attribute features.
[0065] In some embodiments, user attribute characteristics can be determined based on attribute information such as enterprise size, industry, years of establishment, legal entity information or actual controller information, and historical business information. In some embodiments, object attribute characteristics can be determined based on attribute information such as product name, quantity of product resources, product type, and product validity period or lifespan. In some embodiments, the association data generated by users and objects may also include relationship characteristics such as the duration of the association between users and objects, the quantity of object resources associated with the user, and object cost. The above-mentioned characteristic content is added to the association data, and this association data is added to the association data set data1.
[0066] S230. Filter the attribute features of the associated data set, wherein the attribute features include user attribute features and / or object attribute features.
[0067] Feature filtering can reduce redundant information, minimize crashes and model overfitting, improve feature representativeness, retain effective information within features, and enhance feature data quality. Attribute features can also include relational features. For example, attribute features include user attribute features, object attribute features, and relational features. Relational features can refer to the characteristics of events that link users and objects in the associated data.
[0068] In some embodiments, feature selection can be performed using methods such as missing value screening, outlier detection, variance screening, constant value proportion screening, IV value screening, PSI value screening, collinearity screening, and importance screening.
[0069] Among these, missing value screening, outlier detection, variance screening, and constant value proportion screening are used to improve data quality and usability by cleaning features. Missing value screening: This removes features with extremely low information content that are unreliable, reducing the complexity and noise of subsequent calculations. Specifically, it calculates the missing rate (number of missing samples / total number of samples) for each feature. A threshold is set (e.g., >70%); features exceeding this threshold are considered insufficient in information and have excessive imputation costs. Outlier detection: This handles outliers (tailing, truncating, or treating them as missing) instead of directly deleting features, preventing a few extreme values from excessively affecting subsequent statistical analyses (e.g., variance, correlation) and model training. Specifically, it uses statistical methods (e.g., the 3σ principle, box plot method) or business rules to identify extreme values in features that significantly deviate from the main distribution. Variance screening: This removes features with no discriminative power. A feature that is identical to all samples contributes nothing to model prediction and is considered redundant. Specifically, it calculates the variance of each feature. Features with a variance of 0 or close to 0 (e.g., less than 0.4) have almost identical values across all samples. Constant value proportion filtering: This complements variance filtering, especially for categorical features. It eliminates features that may be unbalanced in business applications, exhibit only a single state in modeling, have extremely weak discriminative power, and may introduce unstable factors. Specifically, it calculates the sample proportion of a particular value within a feature (e.g., in the feature "number of presses," "1" accounts for 99%). A single value with an excessively high proportion (e.g., >99%) indicates that the feature has extremely low variability.
[0070] The IV (Information Value) and PSI (Population Stability Index) screening methods are used to evaluate the predictive power and stability of individual features across time and / or groups. IV screening filters features with a clear and significant statistical association with the target variable. IV measures the predictive power of a feature for a target variable (e.g., default). Specifically, it calculates the information value after binning the features. A higher IV value indicates stronger predictive power. The IV screening range is [0.02, 0.5]. PSI screening ensures the stability of the model after deployment. Features with excessively high PSI are removed to prevent a sharp decline in model performance due to drastic changes in feature distribution over time. Specifically, PSI measures the distribution stability of features across different time windows (e.g., training set vs. recent test set) or different groups. A higher PSI value indicates greater distribution differences and less stable features. The PSI screening range is [0, 0.25].
[0071] Among them, collinearity screening, importance screening, and null importance screening are used for fine-tuning from the perspectives of feature groups and models. Collinearity screening: Used to eliminate multicollinearity. Collinearity leads to unstable and difficult-to-interpret model coefficient estimates and may exacerbate overfitting. Only one representative feature needs to be retained. Specifically, this involves calculating the correlation matrix between features or using VIF. Features highly correlated with multiple other features (e.g., correlation coefficient > 0.8 or VIF > 10) are removed. Importance screening: Used to evaluate the true contribution of features from the perspective of non-linear, multi-feature interaction models. Features with the lowest importance ranking are removed; these features have negligible marginal contributions after considering other features. Specifically, a complex ensemble model (such as LightGBM or Random Forest) is used to train on all remaining features and output the model importance ranking of the features. Null Importance screening: Used to identify and remove "false importance" features. If the importance of a feature under the true objective is not significantly higher than its importance under a random objective, it indicates that the importance of the feature is likely due to random noise rather than true predictive power. This step greatly improves the model's generalization ability and prevents overfitting. Specifically, it compares the importance of a feature under the "true target" with its importance under the "random target" to determine whether the feature's importance stems from true predictive ability or merely from random noise.
[0072] Performing feature selection on dataset data1 to form dataset data2 is equivalent to performing feature selection on the associated dataset and updating the associated dataset to form associated dataset data2.
[0073] S240. Obtain other users of the same category as the target user corresponding to the data to be supplemented in the associated data set.
[0074] S250: Obtain the target object associated with the target user in the associated data set.
[0075] S260. Based on each of the target objects, determine the candidate objects of the target users among the other objects associated with each of the other users in the associated data set.
[0076] S270. Generate association data based on the target user and each of the candidate objects, and add it to the association data set so that the association data set generates training samples associated with the target user in a balanced manner.
[0077] The technical solution of this embodiment selects user attribute features and / or object attribute features in the generated associated data set to build an efficient, clean, stable and information-rich feature representation space from the data source, reduce redundant data, improve computational efficiency, improve the effectiveness of feature information, and improve the model's generalization ability and classification accuracy.
[0078] In an optional embodiment, the training data balancing processing method further includes: obtaining data to be extracted from the associated data set; grouping each of the data to be extracted into groups and calculating the group sample ratio; and extracting associated data from each of the data to be extracted and downsampling to update the associated data set according to the group sample ratio.
[0079] Here, the data to be extracted can refer to a large number of related data. The sample size for each user and / or each object can be counted in the related data set. The sample size for an object can refer to the number of related data items including that object. The top n (n is a positive integer) related data items with the largest sample size are determined as the data to be extracted, and the users included in the data to be extracted are determined as the extraction users, and the objects included in the data to be extracted are determined as the extraction objects. In some embodiments, the related data items of the top n users and / or objects with the largest sample size are determined as the data to be extracted. For example, the related data items of the top n users with the largest sample size are determined as the data to be extracted.
[0080] The data to be extracted is grouped to obtain at least one group. The grouping ratio can refer to the ratio of the number of data points to be extracted in different groups. Downsampling can refer to extracting a small amount of data from the data to be extracted. The data to be extracted can be grouped according to the extraction user and / or the extraction object. In some embodiments, the data to be extracted is grouped according to the extraction user, and the number of data points to be extracted within each group is counted. The data to be extracted in the same group are extracted by the same user or the same user category, while the data to be extracted in different groups are extracted by different users or different user categories.
[0081] In some embodiments, the total number of data to be extracted in the associated data set is obtained, associated data is extracted from each data to be extracted according to the sample ratio, the data to be extracted except for the retained associated data is deleted from the associated data set, and the extracted associated data is retained, forming an updated associated data set.
[0082] For example, sampling can be performed according to the sample ratio of data extracted from each user category. For instance, the number of data points to be extracted from user category A is 100, from user category B it is 60, and from user category C it is 40, with a sample ratio of 100:60:40 = 5:3:2. If the total number of data points retained is 20, which is equivalent to retaining 10% of the data (10% × total sample size = 10% × 200 = 20), then the number of data points retained from group A is the ratio of the total number of data points retained to the number of data points retained from group A: 20 × 5 / (5 + 3 + 2) = 10. Similarly, for group B: 20 × 3 / (5 + 3 + 2) = 6, and for group C: 20 × 2 / (5 + 3 + 2) = 4.
[0083] In some embodiments, within the data to be extracted from the same user, the data is grouped according to the extraction object, and the number of data to be extracted within each group is counted. Data in the same group has the same extraction object or the same object category, while data in different groups has different extraction objects or different object categories. The ratio of the number of data to be extracted within each group is calculated. Related data is extracted from the data to be extracted according to the sample ratio, ensuring that related data is retained for each object category. The remaining data is removed from the related data set, and the extracted related data is retained, forming the updated related data set.
[0084] In some embodiments, sampling is performed according to the sample ratio of the extracted data for each object category. For example, the sample ratio of the data to be extracted for different object categories (a, b, c) of a certain user is 3:1:2. Accordingly, the associated data of three object categories a, the associated data of one object category b, and the associated data of two object categories c can be extracted from the data to be extracted for that user.
[0085] It is evident that by identifying the data to be extracted from the associated dataset and grouping the data to be extracted, we can reduce the amount of data while maintaining the original data distribution characteristics to the greatest extent, improving the processing efficiency of training data, and preserving the effective information of the training data.
[0086] In an optional embodiment, obtaining the data to be extracted from the associated data set includes: counting the number of associated data categories corresponding to user categories in the associated data set; obtaining the associated data corresponding to user categories whose number of categories meets the imbalance condition, and determining them as the data to be extracted.
[0087] This process involves clustering users in a user set based on associated user attributes to obtain at least one user category. For each user category, the number of associated data points for each user within that category is counted, and this count is used as the number of categories for that user category. The number of categories for each user category is then determined. An imbalance condition is used to determine whether there is too much associated data for a user category. In some embodiments, the imbalance condition may refer to determining whether the number of categories for a user category is significantly greater than the mean. For example, the mean of the number of categories for each user category is calculated to obtain a mean. The difference between the number of categories for each user category and the mean is calculated, and the number of categories whose difference is greater than or equal to a preset difference threshold is determined to satisfy the imbalance condition.
[0088] The associated data of user categories that meet the imbalance condition are identified as data to be extracted. The associated data of user categories that do not meet the imbalance condition are not identified as data to be extracted.
[0089] As can be seen, by balancing the sample size of statistically related data for user categories, the excess training data for user categories can be accurately calculated, thus achieving precise imbalanced localization.
[0090] In an optional embodiment, after generating association data based on the target user and each of the candidate objects and adding it to the association data set, the method further includes: obtaining an association relationship classification model trained based on the association data set; inputting the application user and the application object into the association relationship classification model to obtain the association relationship classification result between the application user and the application object; and determining whether to push the application object to the application user based on the association relationship classification result.
[0091] The associated data set, adjusted using a training data balancing method, can be used to train an association classification model. In some embodiments, the associated data set is input into a LightGBM (Light Gradient Boosting Machine) model to generate leaf nodes. One-hot feature processing is performed on the leaf nodes, followed by SVD (Singular Value Decomposition) and embedding to reduce the data dimensionality and densify the features. Finally, the LR (Logistic Regression) algorithm is combined for incremental model learning to obtain the trained association classification model.
[0092] In this context, "application user" refers to the user who needs to receive push notifications, and "application object" refers to the object that needs to receive push notifications. Multiple application users and application objects can be input into the association classification model to obtain the classification results of the association relationships between each application user and each application object. When the classification result indicates that an association exists between an application user and an application object, the application object can be pushed to the application user. When the classification result indicates that no association exists, the application object can be excluded from being pushed to the application user.
[0093] It is evident that classifying the relationships between any application user and application object using a relationship classification model based on sample equalization processing can make the relationship classification model more robust in real and complex distributed scenarios. Furthermore, determining whether to push application objects to application users based on the classification results can improve the applicability of real-world scenarios.
[0094] In an alternative embodiment, the association classification model increases the learning weights of the training samples generated by the target user during training.
[0095] In this model, increasing the learning weights of training samples generated by the target user indicates that the model can focus on and learn from samples with a small number of samples, thus enabling the model to focus on training samples generated by the target user. In some embodiments, the learning weights of the target user can be configured in the loss function to increase their learning weights, making them higher than those of other users. Focal Loss can be used to configure these learning weights.
[0096] It is evident that by increasing the learning weights of training samples generated by the target user, the model can focus on the training samples generated by the target user during training, effectively alleviating model bias caused by imbalance and improving the model's classification accuracy.
[0097] In some embodiments, the learning can also be adaptive by configuring the weights for each object category.
[0098] Figure 3 This is a schematic diagram of the training data equalization processing device provided in an embodiment of the present invention. Figure 3 As shown, the training data equalization processing device includes:
[0099] The association data generation module 301 is used to generate an association data entry based on the associated user and object when a user in the user set is associated with an object in the object set, and add it to the association data set. The association data set is used to generate training samples, and the training samples are used to train the association relationship classification model.
[0100] The same type of user identification module 302 is used to obtain other users of the same category as the target user corresponding to the supplementary data in the associated data set;
[0101] Object association module 303 is used to obtain the target object associated with the target user in the association data set;
[0102] The candidate object determination module 304 is used to determine the candidate object of the target user from other objects associated with the other user in the associated data set based on each target object;
[0103] The balanced data supplementation module 305 is used to generate associated data based on the target user and each of the candidate objects, and add it to the associated data set so that the associated data set generates training samples associated with the target user in a balanced manner.
[0104] The technical solution of this invention obtains the target user corresponding to the data that needs to be supplemented in the associated data set, and determines the target user's filtering objects from the objects associated with other users of the same type in the associated data set based on the target user's own associated target objects in the associated data set. It adds associated objects to the target user to generate new associated data, which can increase the associated data of the target user and solve the problem of imbalanced training data for user features in the prior art. It can enrich the data of the users that need to be supplemented, and then train the association relationship classification model based on the balanced associated data set. This can improve the learning and recognition ability of the supplemented user data, reduce model overfitting, and improve the model classification accuracy.
[0105] Optionally, the candidate object determination module 304 includes:
[0106] Other object determination unit, used to obtain other objects associated with each of the other users in the associated data set;
[0107] Other object filtering unit is used to filter out at least one candidate object from among the other objects that belongs to a different object category than the target object.
[0108] Optional, other object filtering units, specifically used for:
[0109] Obtain the first object category to which each of the other objects belongs;
[0110] Obtain the second object category to which each of the target objects belongs;
[0111] Filter out a third object category that is different from each of the second object categories from each of the first object categories;
[0112] For each of the third object categories, candidate objects belonging to different object categories from the target objects are determined based on other objects belonging to the third object category.
[0113] Optional, other object filtering units, specifically used for:
[0114] When there are at least two other objects belonging to the third object category, select one of the other objects belonging to the third object category and determine it as a candidate object whose object category is different from that of each of the target objects.
[0115] Optionally, the similar user determination module 302 includes:
[0116] The user clustering unit is used to cluster each user in the user set according to the associated data set to obtain at least one user category;
[0117] The same-category user filtering unit is used to locate the user category to which the target user belongs and extract other users in the user category to which the target user belongs, excluding the target user.
[0118] Optionally, the similar user determination module 302 includes:
[0119] The sample count unit is used to count the number of samples of the associated data to which the users in the user set belong in the associated data set.
[0120] The data to be supplemented determination unit is used to determine the target user corresponding to the data to be supplemented from each user in the user set based on the number of samples of each user in the user set;
[0121] Other user acquisition unit, used to acquire other users of the same category as the target user.
[0122] Optional training data balancing methods also include:
[0123] The excess sample downsampling module is used for:
[0124] Obtain the data to be extracted from the associated data set;
[0125] The data to be extracted are grouped, and the ratio of the samples in each group is calculated.
[0126] Based on the grouped sample ratio, related data are extracted from each of the data to be extracted and downsampled to update the related data set.
[0127] Optional, an excess sample downsampling module, specifically used for:
[0128] In the associated data set, count the number of associated data categories corresponding to the user categories of the user set;
[0129] Obtain the associated data corresponding to user categories whose number of categories meets the imbalance condition, and determine them as data to be extracted.
[0130] Optional training data balancing methods also include:
[0131] The feature addition module is used to add the user attribute features of the associated user and the object attribute features of the associated object to the generated association data after generating a relationship data based on the associated user and object and adding it to the association data set;
[0132] The feature filtering module is used to filter the attribute features of the associated data set, including user attribute features and / or object attribute features.
[0133] Optionally, the association classification model increases the learning weight of the training samples generated by the target user during training.
[0134] Optional training data balancing methods also include:
[0135] The model inference module is used to obtain the association relationship classification model trained based on the association data set after generating association data based on the target user and each of the candidate objects and adding it to the association data set.
[0136] The application users and application objects are input into the association classification model to obtain the association classification results of the application users and application objects;
[0137] Based on the classification results of the association relationships, determine whether to push the application object to the application user.
[0138] The training data balancing processing device provided in the embodiments of the present invention can execute the training data balancing processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0139] Figure 4 A schematic diagram of the structure of an electronic device 400 that can be used to implement an embodiment of the present invention is shown.
[0140] like Figure 4As shown, the electronic device 400 includes at least one processor 401 and a memory, such as a read-only memory 402 or a random access memory 403, communicatively connected to the at least one processor 401. The memory stores computer programs executable by the at least one processor. The processor 401 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 402 or loaded from storage unit 408 into the random access memory 403. The random access memory 403 may also store various programs and data required for the operation of the electronic device 400. The processor 401, read-only memory 402, and random access memory 403 are interconnected via a bus 404. An input / output interface 405 is also connected to the bus 404.
[0141] Multiple components in electronic device 400 are connected to input / output interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of monitors, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows electronic device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0142] Processor 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 401 performs the various methods and processes described above, such as training data balancing processing methods.
[0143] In some embodiments, the training data balancing processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 400 via read-only memory 402 and / or communication unit 409. When the computer program is loaded into random access memory 403 and executed by processor 401, one or more steps of the training data balancing processing method described above may be performed. Alternatively, in other embodiments, processor 401 may be configured to perform the training data balancing processing method by any other suitable means (e.g., by means of firmware).
[0144] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), complex programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0145] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0146] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, flash memory, optical fiber, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0147] To provide user interaction, the systems and techniques described herein can be implemented on an operational detection device. This rule processing device includes: a display device (e.g., a cathode ray tube or liquid crystal display monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the rule processing device. Other types of devices can also be used to provide user interaction; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0148] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0149] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product within the cloud computing service system. This addresses the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0150] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0151] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A training data balancing method, characterized in that, include: When a user in the user set is associated with an object in the object set, an association record is generated based on the associated user and object and added to the association data set. The association data set is used to generate training samples, and the training samples are used to train the association relationship classification model. Obtain other users of the same category as the target user corresponding to the data to be supplemented in the associated data set; Obtain the target object associated with the target user in the associated data set; Based on each target object, candidate objects of the target users are determined from other objects associated with each of the other users in the associated data set; Association data is generated based on the target user and each of the candidate objects, and added to the association data set so that the association data set generates training samples associated with the target user in a balanced manner.
2. The method according to claim 1, characterized in that, The step of determining candidate objects of the target users from other objects associated with each of the other users in the associated data set based on each target object includes: Retrieve other objects associated with each of the other users in the associated data set; Among the other objects, at least one candidate object is selected that belongs to a different object category than the target object.
3. The method according to claim 2, characterized in that, The step of filtering out at least one candidate object from among the other objects that belongs to a different object category than the target object includes: Obtain the first object category to which each of the other objects belongs; Obtain the second object category to which each of the target objects belongs; Filter out a third object category that is different from each of the second object categories from each of the first object categories; For each of the third object categories, candidate objects belonging to different object categories from the target objects are determined based on other objects belonging to the third object category.
4. The method according to claim 3, characterized in that, The step of determining candidate objects belonging to a different object category from each of the target objects based on other objects belonging to the third object category includes: When there are at least two other objects belonging to the third object category, select one of the other objects belonging to the third object category and determine it as a candidate object whose object category is different from that of each of the target objects.
5. The method according to any one of claims 1-4, characterized in that, The step of obtaining other users of the same category as the target user corresponding to the supplementary data in the associated data set includes: Based on the associated data set, cluster each user in the user set to obtain at least one user category; Locate the user category to which the target user belongs, and extract other users in the user category to which the target user belongs, excluding the target user.
6. The method according to claim 1, characterized in that, The step of obtaining other users of the same category as the target user corresponding to the supplementary data in the associated data set includes: In the associated data set, the number of samples of associated data belonging to the users in the user set is counted; Based on the number of samples for each user in the user set, determine the target user corresponding to the data to be supplemented from each user in the user set; Obtain other users in the same category as the target user.
7. The method according to claim 1, characterized in that, Also includes: Obtain the data to be extracted from the associated data set; The data to be extracted are grouped, and the ratio of the samples in each group is calculated. Based on the grouped sample ratio, related data are extracted from each of the data to be extracted and downsampled to update the related data set.
8. The method according to claim 7, characterized in that, The step of obtaining the data to be extracted from the associated data set includes: In the associated data set, count the number of associated data categories corresponding to the user categories of the user set; Obtain the associated data corresponding to user categories whose number of categories meets the imbalance condition, and determine them as data to be extracted.
9. The method according to claim 1, characterized in that, After generating a relationship record based on the associated user and object and adding it to the relationship data collection, the process also includes: Add the user attribute characteristics of the associated users and the object attribute characteristics of the associated objects to the generated association data; The attribute features of the associated data set are filtered, and the attribute features include user attribute features and / or object attribute features.
10. The method according to claim 1, characterized in that, The association classification model increases the learning weight of the training samples generated by the target user during training.
11. The method according to claim 1, characterized in that, After generating association data based on the target user and each of the candidate objects, and adding it to the association data set, the method further includes: Obtain the association classification model trained based on the associated data set; The application users and application objects are input into the association classification model to obtain the association classification results of the application users and application objects; Based on the classification results of the association relationships, determine whether to push the application object to the application user.
12. A training data balancing processing device, characterized in that, include: The association data generation module is used to generate an association data entry based on the associated user and object when a user in the user set is associated with an object in the object set, and add it to the association data set. The association data set is used to generate training samples, and the training samples are used to train the association relationship classification model. The same type of user identification module is used to obtain other users of the same category as the target user corresponding to the supplementary data in the associated data set; The object association module is used to obtain the target object associated with the target user in the association data set; A candidate object determination module is used to determine, based on each target object, candidate objects of the target user among other objects associated with each other user in the associated data set; The balanced data supplementation module is used to generate associated data based on the target user and each of the candidate objects, and add it to the associated data set so that the associated data set generates training samples associated with the target user in a balanced manner.
13. An electronic device for training data equalization processing, characterized in that, The system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the training data balancing processing method as described in any one of claims 1-11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the training data balancing processing method as described in any one of claims 1-11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the training data balancing processing method as described in any one of claims 1-11.