Downsampling
By classifying and downsampling data points based on attribute values, the method addresses inaccuracies and unfairness in traditional downsampling, enhancing model accuracy and fairness in machine learning.
Patent Information
- Application Number
- JP2025072919
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-05-13
- Filing Date
- 2025-04-25
- Publication Date
- 2025-11-26
AI Technical Summary
Traditional downsampling methods for training machine learning models introduce inaccuracies and unfairness due to their suboptimal approach, particularly in imbalanced datasets with protected attributes.
A method involving the classification of data points into primary subsets based on attributes, followed by downsampling sub-subsets to retain points with the smallest average distance to the furthest points in the primary subset, thereby preserving critical boundary information for accurate model training.
This approach enhances the accuracy and fairness of machine learning models by maintaining crucial data points near decision boundaries, reducing underfitting and improving predictive performance.
Smart Images

Figure 2025172697000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to downsampling, and in particular to a computer-implemented method, a computer program and an information programming apparatus. [Background technology]
[0002] Machine learning (ML) models have proven useful for predicting the value of an attribute of data based on the values of other attributes of the data instance. For example, classifiers are useful for predicting the class of a data instance based on the values of the data instance with respect to other attributes.
[0003] The accuracy and fairness of an ML model depend, at least in part, on the training data used to train the ML model. The training data may be imbalanced with respect to classes or other attributes. For example, the training data may be imbalanced with respect to so-called protected attributes on which the ML model is not configured to base its predictions. The more imbalanced the training dataset, the more inaccurate or unfair the resulting ML model may be (e.g., with respect to certain groups). Summary of the Invention [Problem to be solved by the invention]
[0004] Downsampling is useful in some situations to address imbalances in training data for training ML models. However, traditional downsampling methods are suboptimal and can introduce other issues in downsampled training datasets.
[0005] In view of the above, downsampling methods are desirable, which may be applied, for example, in downsampling training datasets for training ML models. [Means for solving the problem]
[0006] The invention is defined by the independent claims, to which reference should now be made, with particular embodiments being defined in the dependent claims.
[0007] According to an embodiment of the first aspect, the computer-implemented method disclosed herein includes the steps of: classifying each data point in a training dataset into one of a plurality of primary subsets based on values of the data point for (at least) a first and a second attribute (wherein each primary subset corresponds to a particular value for (at least) a first and a second attribute) (wherein, for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute), where each data point is defined by a plurality of attributes including said at least the first and the second attribute; selecting a particular value for the first attribute and dividing each of the primary subsets corresponding to the selected value for (at least) the first attribute into a plurality of sub-subsets; and, for each of the primary subsets corresponding to the selected value for (at least) the first attribute, downsampling the plurality of sub-subsets with respect to other primary subsets to respectively divide a plurality of downsampled sub-subsets. generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of primary subsets other than the primary subset corresponding to selected values of (for) the first attribute, said downsampling including: calculating, for each data point in the sub-subset, an average distance (distance) to the k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the associated sub-subset) n data points of the associated sub-subset having the greatest calculated average distance (to each of the k furthest data points of the associated primary subset), to generate the associated downsampled sub-subset, where k and n are positive integers. [Brief explanation of the drawings]
[0008] Reference will now be made, by way of example, to the accompanying drawings in which: [Figure 1] 1 is a graph showing a data set. [Figure 2] 1 is a graph showing a data set. [Figure 3] FIG. 1 illustrates a data set. [Figure 4] FIG. [Figure 5] FIG. [Figure 6] FIG. [Figure 7] 1 is a graph showing a data set. [Figure 8] 1 is a graph showing a data set. [Figure 9] 1 is a graph showing a data set. [Figure 10] 1 is a graph showing a data set. [Figure 11] FIG. [Figure 12] FIG. [Figure 13] FIG. [Figure 14] 10 is a graph showing the results. [Figure 15] FIG. 1 shows an apparatus. DETAILED DESCRIPTION OF THE INVENTION
[0009] The following definitions may be used herein but are not exhaustive.
[0010] Binary classification: A classification problem in which observations are categorized into one of two classes (e.g., true or false, 0 or 1, yes or no).
[0011] Supervised Learning: A category of machine learning that uses labeled datasets to predict outcomes and recognize patterns.
[0012] Attributes: A training dataset contains data instances, each defined by several attributes, i.e., a given data instance is defined by the values for those attributes. Attributes are sometimes called features, predictors, variables, or properties.
[0013] Protected attribute: A feature of a dataset that may not be used as the basis for a decision by, for example, an ML model. Protected attributes may be selected due to legal requirements, moral values, etc. Some common protected attributes include age, gender, nationality, race, age, etc.
[0014] Privileged Group: A group that has historically been more likely to receive a favored label in machine learning classification tasks.
[0015] Non-privileged group: A group that is not given a privilege, that is, a group other than a privileged group. When a data set is divided according to protection attributes, the groups can correspond to privileged groups and non-privileged groups.
[0016] Imbalanced or unbalanced dataset: A dataset with skewed class and / or group proportions.
[0017] Degree of imbalance: A concept that characterizes the amount of imbalance in a dataset. For example: mild imbalance (the minority class comprises 20-40% of the dataset), moderate imbalance (the minority class comprises 1-20% of the dataset), and extreme imbalance (the minority class comprises <1% of the dataset).
[0018] Minority class: A class that makes up a small proportion of a dataset.
[0019] Majority class: A class that makes up a large proportion of a dataset.
[0020] Downsampling: Also known as undersampling, is the process of using a smaller set of a given dataset, for example, used to train an ML model.
[0021] Oversampling: A method of creating or replicating new synthetic examples of a given dataset.
[0022] Statistical Parity Difference: A metric for assessing the fairness of a system. It is based on the principle that privileged and unprivileged groups should receive an equal proportion of positive labels.
[0023] Equal Opportunity Difference: A fairness metric that evaluates the difference in true positive rates for privileged and non-privileged groups.
[0024] Average odds difference: A fairness metric that represents the average difference between the false positive and true positive rates for privileged and non-privileged groups.
[0025] True positive rate: A metric for evaluating the performance of a binary classification model. It is defined as the proportion of actual positive cases that are correctly identified by the model.
[0026] False positive rate: A metric for evaluating the performance of a binary classification model. It is defined as the proportion of positive cases that are incorrectly identified as positive by the model.
[0027] k-Nearest Neighbors: A machine learning technique used for classification and regression tasks.
[0028] As an example illustrating imbalance in training data, one can consider a binary classification problem with two classes C1 and C2 and one protected attribute that divides the dataset into two groups G1 and G2 (privileged and unprivileged). For simplicity, we consider only one protected attribute here; generalization to more than two protected groups should be obvious. Two notions of imbalance can be considered: 1. Class Imbalance 2. Group Imbalance
[0029] In this case, the protected attribute is gender and the groups are male and female. From the table below, which gives the number of data instances / records for each group / class combination, we can see that there are more false records than true (class imbalance) and more records for male than female (group imbalance). [Table 1]
[0030] ML classifiers learn more from the majority class present in the training data, which can affect accuracy and fairness.
[0031] Class imbalance can be considered to primarily affect accuracy, while group imbalance can be considered to primarily affect fairness.
[0032] As an example, consider a training dataset for training an ML model (analyzer) to predict the presence or absence of diabetes, i.e., a medical cohort analysis of diabetes. The training dataset corresponds to human subjects and includes data instances defined by values for multiple attributes, such as pregnancy, glucose level, blood pressure, skinfold thickness, insulin level, BMI, diabetes antecedent factors, age, and outcome.
[0033] Figure 1 shows data points from a training dataset across two attributes (e.g., glucose level and BMI, or any other such attribute) labeled X1 and X2. Each data point corresponds to a data instance, i.e., a human subject. The data points are classified according to their group (male or female) and class (diabetes test positive or diabetes test negative). Most of the records are from males and test negative. When training an ML model to predict class (presence of diabetes), the resulting trained model may be inaccurate because it was trained using a dataset with fewer female records compared to males (and fewer positive records compared to negative).
[0034] One way to address imbalanced classification problems is to change the composition of the training dataset. Such a technique is called sampling. Sampling is performed only on the training dataset, not on the validation dataset.
[0035] Some conventional sampling methods include: Random Data Sampling Oversampling method Downsampling method Combining oversampling and downsampling Traditional downsampling methods tend not to consider fairness, and in fact, fairness often worsens after downsampling.
[0036] The comparative method will be described with reference to Figure 2. Figure 2 shows the data points of a dataset according to the values for attributes X1 and X2. The data points are classified and labeled according to their group and class. The majority class is labeled with a plus - this is the most common class in the dataset. The classification results in subsets of points M1, M2, m1, and m2 as shown in Figure 2.
[0037] In the comparative method, the subset corresponding to the majority class is randomly downsampled. In random downsampling, points are randomly selected to be removed from the dataset (or randomly selected to be included, and the remaining points are removed). For example, as shown in Figure 2, the result of random downsampling is that the circled points are removed from the dataset.
[0038] The benefit for fairness comes from balancing the sizes of different groups. However, the above random downsampling technique may remove data points near the boundary between subsets in the attribute space of X1 and X2. This may affect the predictive performance of ML models trained using the downsampled dataset, leading to underfitting.
[0039] Figure 3 shows a representative example to demonstrate underfitting. The left side (LHS) is the training dataset before downsampling, and the right side (RHS) is the training dataset after random downsampling. A classifier (DecisionTreeClassifier (https: / / scikit-learn.org / stable / modules / generated / sklearn.tree.DecisionTreeClassifier.html, https: / / en.wikipedia.org / wiki / Decision_tree_learning)) trained from the original training dataset and the resulting decision boundary are shown on the LHS graph. The same classifier trained from the downsampled training dataset and the resulting decision boundary are shown on the RHS graph. After random downsampling, the decision boundary simplifies to a straight line, thus leading to a loss of accuracy (and fairness). This phenomenon is the opposite of overfitting, a negative effect that can result from oversampling.
[0040] FIG. 4 illustrates an overview of a method for downsampling a training dataset and training an ML model (classifier). In steps S110 and S120, data is divided into a training dataset and a test dataset. In step S130, downsampling is performed on the training dataset. In step S140, a classifier is trained using the downsampled training dataset, and in step S150, the trained classifier is evaluated using a (non-downsampled) test dataset. A downsampling technique disclosed herein may be implemented in step S130. The method disclosed herein includes a downsampling technique and an overall method corresponding to the overview of FIG. 4 that includes such a downsampling technique in step S130.
[0041] 5 is a diagram illustrating the method, which includes steps S210, S220, S231, S232, S241, and S242.
[0042] The problem setting to which this method is applied is summarized as follows: Input: Observation / original dataset D={X i ,Y i ,G i}, i=1~n, where X refers to the feature, i.e., the attribute value of a record, Y refers to the class of the record, and G refers to the group of records. Output: Downsampled dataset Evaluation metric: Statistical parity difference, equal opportunity difference, equalized odds difference, or balanced accuracy. Evaluation classifier (used in the evaluation as described below with respect to Figure 14): LogisticRegression, SVC, RandomForestClassifier, KNeighborsClassifier, XGBClassifier, GaussianNB, GradientBoostingClassifier, DecisionTreeClassifier.
[0043] As an example, the method of FIG. 5 may be considered relevant to a medical cohort analysis of diabetes using a distance-based unbiased downsampling technique. That is, in this example, the input data is medical data including records corresponding to human subjects, including values for attributes that may include, for example, any of pregnancy, glucose level, blood pressure, skinfold thickness, insulin level, BMI, diabetes antecedent, age, and outcome. In this case, the class is whether the human subject tested positive for diabetes, and the group is either male or female. As noted above, the class is the attribute that the ML model is trained to predict using the downsampled training dataset.
[0044] Step S210 involves splitting dataset D into groups Gi and classes Ci. This involves splitting the dataset into classes (positive tests for diabetes and negative tests for diabetes) and then splitting again into groups (males and females), or vice versa. The result (two possible classes and two possible groups) in this case is four subsets of dataset D. These subsets are labeled M1, M2, m1, and m2. The result of step S210 is shown in FIG. 7, which is a graph showing the points of dataset D after splitting into four subsets. FIG. 7 shows data points of a training dataset across two attributes (which could be, for example, glucose level and BMI, or any other such attributes) labeled X1 and X2. Each data point corresponds to a data instance, i.e., a human subject. A legend indicates which subset each point corresponds to. "+" represents the class of positive test results for diabetes, which in this case is the majority class, "-" represents the class of negative test results for diabetes, "Group 1" corresponds to males and "Group 2" corresponds to females.
[0045] Step S220 involves identifying a majority class and a minority class for each group, where, as noted above, the subsets corresponding to the majority class are M1 and M2, and the subsets corresponding to the minority class are m1 and m2.
[0046] Step S231 includes dividing M1 into three random, non-overlapping sets of points S i , also called sub-subsets. Step S232 includes dividing M2 into three random, non-overlapping sets of points T i , also called sub-subsets. In steps S231 and S232, the sub-subsets may all have the same size, or they may be sized proportionally to the other subsets. That is, sub-subset S i may be sized proportionally to subsets m1, m2, and M2, and sub-subset T i may be sized proportionally to subsets m1, m2, and M1.
[0047] Figure 8, like Figure 7, shows two graphs illustrating points of data set D. Figure 8 shows sub-subsets Si and Ti: subset M1 is divided into sub-subsets Si, represented by filled (solid) shapes, with each sub-subset Si represented by a different shape (square, triangle, circle), and subset M2 is divided into sub-subsets Ti, represented by unfilled shapes, with each sub-subset Ti represented by a different shape (square, triangle, circle).
[0048] The division in steps S231 and S232 is performed by a random divider (uniform division), because each auxiliary subset should follow the distribution of the original sets (M1 and M2) as closely as possible.
[0049] The size of each of the auxiliary subsets can be considered as a hyperparameter of the process that can be adjusted. As mentioned above, two possible options are Uniform partition (each of the three sets has the same size) Partitions proportional to the sizes of the other sets appearing in the problem. For example, the partition of M1 is proportional to the sizes of M2, m1, and m2.
[0050] Steps S231 and S242 involve downsampling sub-subset S with respect to subsets m1, m2, and M2, and downsampling sub-subset T with respect to subsets m1, m2, and M1, respectively. These steps are described in more detail below with reference to FIG. 6.
[0051] 6 illustrates a method for downsampling a given sub-subset with respect to a subset, where step S231 includes performing the method of FIG. 6 for each of the sub-subsets S i , and step S232 includes performing the method of FIG. 6 for each of the sub-subsets T i .
[0052] 6 is described for a sub-subset S. In step S310, the sub-subset S is selected for downsampling with respect to the corresponding set m. For example, the sub-subset S may be S1, and the subset m1.
[0053] Step S320 involves selecting a point si of the auxiliary subset S. Step S330 involves calculating the average distance d i to the n most distant data points of m. In this case, a k-nearest-neighbors (KNN) algorithm is used. The distance d i is in the feature or attribute space X1 and X2. That is, the distance d i is with respect to the attributes X1 and X2. In this case, n=3, although this is not essential. In this step, the n most distant data points of the subset m are determined, and then the average distance d i is calculated based on the distances of these n points from point si.
[0054] Steps S320 and S330 are performed for all points in the sub-subset S.
[0055] Step S340 involves forming a set of all distances di, i.e., the result of performing steps S320 and S330 for all points in auxiliary subset S. Step S350 involves retaining data points in S with the smallest average distance di. For example, a certain number of points with the smallest average distance di to the n furthest data points in subset m are retained. This step may be thought of as discarding a certain number of points with the largest average distance di to the n furthest data points in subset m. The result of step S350 is a downsampled auxiliary dataset S' corresponding to auxiliary dataset S.
[0056] As discussed above, the method of FIG. 6 is performed for each sub-subset Si as part of step S241, and the method of FIG. 6 is performed for each sub-subset Ti as part of step S242.
[0057] The results of steps S241 and S242 are downsampled sub-subsets S i ' and T i '. A downsampled training data set D' may be generated / constructed by combining the downsampled sub-subsets and subsets m1 and m2.
[0058] The graph on the left side of FIG. 8 shows the calculation of the average distance di for points of sub-subset S to subset m1, and the graph on the right side of FIG. 8 shows the calculation of the average distance di for points of sub-subset S to subset m2.
[0059] 9 and 10 show the data points of dataset M divided into subsets and sub-subsets in the same manner as in FIG.
[0060] The graph on the left side of FIG. 9 shows the calculation of the average distance di for points of sub-subset T to subset m2, and the graph on the right side of FIG. 9 shows the calculation of the average distance di for points of sub-subset T to subset m1.
[0061] The graph on the left side of FIG. 10 shows the calculation of the average distance di for points of sub-subset T to subset M1, and the graph on the right side of FIG. 10 shows the calculation of the average distance di for points of sub-subset S to subset M2.
[0062] When downsampling a given subsubset with respect to its paired subset, by retaining points with the smallest average distance d to their k furthest points, points close to the boundary between the subsubset and its paired subset are more likely to be retained, while points further away from the boundary are more likely to be discarded in the downsampling. The boundary may, for example, relate to a decision boundary for an ML model trained using the downsampled training dataset. As described above, this is done for each subsubset with respect to the other subsets, so that the subset corresponding to the majority class is downsampled, but points important for forming the decision boundary between different subsets in training the ML model are retained.
[0063] The number of points discarded is a parameter that can be selected and adjusted.
[0064] Although the above-described method only involved two attributes X1 and X2, any number of attributes may be considered. That is, each data point / record may be defined by multiple attributes, for example, more than two attributes. Although the above-described method has been described considering an example in which the classes relate to the presence or absence of diabetes and the groups are male and female, this is not essential and the data may relate to other scenarios.
[0065] Figure 11 illustrates a method that can be considered to correspond to the methods described above with respect to Figures 5 and 6.
[0066] In step S1, the input data D={X,Y,S} is divided into clusters / subsets C based on the group and class to which the records belong / correspond. y,sThe data points / records of dataset D are defined by attributes X, classes Y, and groups S, similar to the dataset described with respect to Figure 5. For example, if there are two possible classes and two possible groups, then there are four clusters C y,s If there are two possible classes and three possible groups, or three possible classes and two possible groups, there will be six clusters C y,s As mentioned above, a protected attribute gives rise to a group. There may be more than one protected attribute, for example, two protected attributes. In this case, the data set may be considered to be defined as D = {X, Y, S, S^}, where S and S^ correspond to the two protected attributes. If there are two classes and each protected attribute S, S^ gives rise to two groups, then there are eight subsets C y,s There will be.
[0067] Step S2 is to calculate the number of clusters C y,s This involves calculating the size of , in terms of the number of data points in it.
[0068] Step S3 involves finding the largest and smallest clusters and calculating the ratio between the number of points in the largest cluster and the number of points in the smallest cluster. This ratio is compared to a hyperparameter p, which indicates the desired amount of downsampling. If the ratio satisfies a threshold associated with the hyperparameter p, the method ends. If the ratio does not satisfy the threshold associated with the hyperparameter p, the method proceeds to step S4. Step S3 can be considered as checking whether downsampling is necessary, i.e., whether the dataset D is imbalanced to the extent that downsampling is necessary.
[0069] Step S4 involves selecting a cluster to be downsampled. The cluster Ci to be downsampled is selected from among the clusters corresponding to a particular class, preferably the majority class (if there is one).
[0070] Step S5 divides the cluster Ci into an auxiliary subset C i k where U k C i k = Ci. As in the method of Figure 5, the number of sub-subsets into which cluster Ci is divided depends on the total number of clusters, i.e., cluster Ci is divided into h sub-subsets, where h+1 is the number of clusters.
[0071] Step S6 involves selecting a cluster Cj, where j is different from i, i.e., a cluster other than the cluster currently selected for downsampling. Step S7 involves selecting an auxiliary subset Cj with respect to cluster Cj. i k Downsampling the auxiliary subset with respect to a cluster includes retaining the number of points in the auxiliary data set that have the smallest average distance to the k most distant points of the cluster, as described above with respect to FIG.
[0072] The method includes repeating steps S6 and S7, whereby steps S6 and S7 are performed for all clusters Cj except for the cluster Cj currently selected for downsampling. Each time step S7 is performed, a different auxiliary subset C i k is selected (i.e., a different k). As in the method of Figure 5, the sub-subsets may be paired with clusters other than the cluster from which the sub-subsets were divided. The sub-subsets may be generated with sizes proportional to the clusters other than the cluster from which the sub-subsets were divided, or alternatively, the sub-subsets may all be generated to have the same size.
[0073] Steps S4-S7 are repeated for all clusters to be downsampled, i.e., all clusters corresponding to the majority class, and then the method proceeds to step S8. Step S8 includes calculating a fairness, i.e., a fairness metric, and comparing the fairness metric to a threshold fairness metric. If the fairness metric meets the fairness metric threshold, the method proceeds to step S3. If the fairness metric does not meet the fairness metric threshold, the method proceeds to step S9 and then step S4, where downsampling is performed again for each cluster to be downsampled.
[0074] That is, when steps S4 to S7 are repeated after step S9, downsampling according to steps S4 to S7 is performed on the downsampled clusters resulting from the previous iteration of steps S4 to S7. Each downsampled cluster includes a downsampled sub-subset corresponding to a sub-subset split from the cluster corresponding to the downsampled cluster. Therefore, step S5 need not be performed when steps S4 to S7 are repeated. Alternatively, the downsampling process may be performed again based on the original sub-subset, but a different number (e.g., fewer) of points may be retained in each case, and thus step S5 need not be performed again. Alternatively, steps S5 to S7 may all be performed again based on the original cluster, but a different number (e.g., fewer) of points may be retained in each case. Thus, step S5 is performed again, and the sub-subset is not necessarily the same as the sub-subset generated when steps S5 to S7 were first performed. If a different number (e.g., fewer) of points are retained in each case of downsampling the sub-subset, step S9 may include changing (e.g., increasing) the amount of downsampling, i.e., changing (decreasing) the number of points retained when downsampling each sub-subset.
[0075] After the method is complete, a downsampled training dataset D' may be generated / constructed by combining the downsampled auxiliary subset with clusters that were not among the clusters to be downsampled (i.e., clusters corresponding to minority classes).
[0076] 5 / 6 and 11, it will be understood that step S1 can be considered to correspond to step S210, steps S2 and S3 to step S220, step S5 to steps S231 and S232, and step S7 to steps S241 and S242. The description of any given step in the method of FIG. 5 / 6 or 11 may apply to the corresponding step in the other method.
[0077] The following fairness measures will now be described: statistical parity difference, disparate impact, equality of opportunity difference, equality of opportunity ratio, average odds difference, and average odds ratio, and the fairness measure calculated in step S8 may include any of these.
[0078] Demographic parity is based on the principle that groups should receive an equal proportion of positive labels. This can be monitored by fairness metrics statistical parity difference and / or unequal impact. Statistical parity difference: f = Prob(Y'=1|A=0) - Prob(Y'=1|A=1) Uneven impact: f = Prob(Y'=1|A=0) ÷ Prob(Y'=1|A=1) Here, the true positive rate Prob(Y'=1) is defined as follows: Prob(Y'=1) = [TP+FP] ÷ [P+N] where TP is true positive, FP is false positive, P is total positive (TP + FP), N is total negative (true negative TN + false negative FN), Y is the actual class of the data record, and Y' is the predicted class of the data record. A=0 and A=1 refer to two different groups.
[0079] Equality of opportunity is based on the principle that groups should have equal true positive rates (TPR). Equal opportunity difference: f = Prob(Y'=1|A=0,Y=1) - Prob(Y'=1|A=1,Y=1) Equal opportunity ratio: f=Prob(Y'=1|A=0,Y=1)÷Prob(Y'=1|A=1,Y=1)
[0080] The mean odds are based on the principle that groups should have equal TPR and equal false positive rates (FPR). Average odds difference: f=(1 / 2)*[|Prob(Y'=1|A=0,Y=1)-Prob(Y'=1|A=1,Y=1)| + |Prob(Y'=1|A=0,Y=0)-Prob(Y'=1|A=1,Y=0)|] Average odds ratio: f=(1 / 2)*[|Prob(Y'=1|A=0,Y=1)÷Prob(Y'=1|A=1,Y=1)| + |Prob(Y'=1|A=0,Y=0)÷Prob(Y'=1|A=1,Y=0)|]
[0081] It will be appreciated that the above fairness metrics utilize predictions of an ML model. Thus, step S8 may include training an ML model using the downsampled dataset, where the ML model is configured to predict the class of a given data record based on attribute / feature X (but not based on the attribute that determines the group to which the record belongs), and evaluating the trained ML model using test data to obtain a prediction of class Y' for each record in the test data, thereby allowing the above-mentioned quantities (TPR, FPR, etc.) to be calculated.
[0082] The above example of a fairness metric assumes one protected attribute resulting in two groups and two possible classes. For protected attributes resulting in more than two groups, the fairness metric described above may be calculated for any two groups, or a fairness metric may be calculated as described above for each combination of two groups, and the fairness metric may be combined to generate an overall fairness metric. If there are more protected attributes, a fairness metric may be calculated for each protected attribute, and the fairness metric may be combined to generate an overall fairness metric.
[0083] In the case of more than two classes, for example, for one class compared to each other class, any of the above fairness metrics may be utilized and then combined. For binary classification problems and for more than two classes (e.g., https: / / www.evidentlyai.com / classification-metrics / multi-class-metrics), it will be understood that there are many metrics for evaluating fairness, and the above metrics are described above as examples for binary classification problems. For example, the true positive rate (TPR) and false positive rate (FPR) may be calculated separately for each class (TPR_class_i=TP_class_i / [TP_class_i+FN_class_i]), and from such quantities, many fairness metrics may be calculated (e.g., the average TPR or FPR across all classes).
[0084] Figure 12 is a diagram illustrating a method. The method of Figure 12 can be considered to correspond to the methods of Figures 5 / 6 and 11. The method of Figure 12 includes steps S10, S20, S30, S40, and S50.
[0085] Step S10 includes classifying the training data set into a plurality of primary subsets. That is, step S10 includes classifying each data point in the training data set into one of a plurality of primary subsets based on the data point's values for at least a first and a second attribute. Each primary subset corresponds to a particular value for at least a first and a second attribute. After classification, for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute. Each data point is defined by values for a plurality of attributes, including the at least a first and a second attribute.
[0086] Step S20 includes selecting a value for the first attribute. That is, step S20 includes selecting a particular value for the first attribute. This may be the most common value for the first attribute (the majority value) in the training dataset. If there is no imbalance in the dataset with respect to the first attribute, the value for the first attribute may be selected randomly.
[0087] Step S30 includes dividing each primary subset corresponding to the selected value into sub-subsets, i.e., step S30 includes dividing each primary subset corresponding to the selected value for the first attribute into a plurality of sub-subsets.
[0088] Step S40 includes, for each primary subset corresponding to the selected value, downsampling the sub-subset with respect to each of the other primary subsets to generate downsampled sub-subsets. That is, step S40 includes, for each of the primary subsets corresponding to the selected value with respect to the first attribute, downsampling the multiple sub-subsets with respect to each of the other primary subsets to generate multiple downsampled sub-subsets. For a given primary subset corresponding to the selected value, each sub-subset can be considered to correspond to one of the other primary subsets.
[0089] Step S50 includes generating a downsampled training dataset, i.e., step S50 includes generating a downsampled training dataset for training an ML model to predict (values of) a first attribute, the downsampled training dataset including data points of the downsampled auxiliary subset and, for the first attribute, data points of a primary subset other than the primary subset corresponding to the selected value.
[0090] The downsampling in step S40 includes steps S41-S46 shown in the method of FIG. 13. Step S41 includes selecting a sub-subset. Step S42 includes calculating, for each data point in the sub-subset, an average distance to the k furthest data points of the corresponding primary subset (i.e., the primary subset for which the sub-subset is down-sampled). That is, step S42 includes calculating, for each data point in the sub-subset, an average distance to the k furthest data points of the primary subset with respect to a plurality of attributes other than the at least first and second attributes (i.e., in the feature space of a plurality of attributes other than the at least first and second attributes).
[0091] Step S43 includes removing the n data points with the largest average distances, i.e., step S43 includes removing the n data points of the sub-subset with the largest calculated average distances (to each of the k farthest data points of the primary subset) from the sub-subset to generate the down-sampled sub-subset, where k and n are positive integers.
[0092] Step S43 may be thought of as selecting the n' data points of the sub-subset having the smallest calculated average distances (to the k furthest data points of each of the primary subset) for inclusion in the down-sampled sub-subset. Depending on the choice of n and n', this will be the same process as described for step S43 above.
[0093] Step S45 involves determining whether any sub-subsets remain that have not been downsampled. If so, the method returns to step S41 and that sub-subset is selected. If not, the method ends.
[0094] There may be more than two possible values of the first attribute. That is, if the value of the first attribute is considered a "class," there may be more than two classes. In this case, a single class may be selected, and the method may be the same as described above, or another class may be additionally selected, and then division into auxiliary subsets and downsampling may be performed for that other class in the same manner as defined in steps S30 and S40. Any number of classes (e.g., w most common classes, where w is a positive integer) may be selected, and division into auxiliary subsets and downsampling may be performed for those selected classes in the same manner as defined in steps S30 and S40. The same applies to the methods of FIGS. 5 / 6 and 11. That is, if there are more than two classes, any number of classes may be selected (e.g., w most common classes, where w is a positive integer), and division into sets Si / Ti (also called auxiliary subsets) and downsampling may be performed in the same manner as defined in the corresponding steps of those methods.
[0095] As mentioned above, a computer-implemented method is disclosed herein, comprising the steps of: classifying each data point in a training dataset into one of a plurality of primary subsets based on values of the data point for (at least) a first and a second attribute, whereby each primary subset corresponds to a particular value for (at least) the first and second attributes, whereby, for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute, where each data point is defined by a plurality of attributes including the at least the first and second attributes; selecting a particular value for the first attribute and dividing each of the primary subsets corresponding to the selected value for (at least) the first attribute into a plurality of sub-subsets; and, for each of the primary subsets corresponding to the selected value for (at least) the first attribute, downsampling the plurality of sub-subsets with respect to each other primary subset to form a plurality of downsampling sub-subsets. generating a downsampled sub-subset; and generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of a primary subset other than the primary subset corresponding to a selected value of (for) the first attribute, wherein the downsampling includes: calculating, for each data point in the sub-subset, an average distance (distance) to k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the sub-subset) n data points of the sub-subset having the largest calculated average distance (to each of the k furthest data points of the primary subset) to generate the downsampled sub-subset, where k and n are positive integers.
[0096] The second attribute may be a protected attribute.
[0097] The ML model may be configured to predict the first attribute based on the plurality of attributes other than at least the second attribute.
[0098] The first attribute for a given data point may include one of two values.
[0099] The ML model may be configured to classify the data points with respect to the first attribute.
[0100] The ML model may be configured to classify the data points with respect to the first attribute, where the classification comprises a binary classification.
[0101] Selecting a particular value for the first attribute may include selecting a majority value for the first attribute when the training dataset is imbalanced with respect to the first attribute, the majority value being the most common value in the training dataset with respect to the first attribute.
[0102] Selecting a particular value for the first attribute may include selecting a majority value for the first attribute if a majority value for the first attribute exists, the majority value being the most common value in the training dataset for the first attribute.
[0103] Selecting a particular value for the first attribute may include selecting the most common value in the training dataset for the first attribute when the training dataset is imbalanced with respect to the first attribute.
[0104] The computer-implemented method may include selecting at least one other value of the first attribute; for each selected at least one other value of the first attribute, dividing each of the primary subsets corresponding to the selected other value of the first attribute into a plurality of further sub-subsets; and down-sampling the further sub-subsets, wherein the down-sampled training data set includes data points of the down-sampled sub-subsets, data points of the down-sampled further sub-subsets, and data points of the primary subsets other than the primary subset corresponding to the selected value of the first attribute and the primary subset corresponding to the selected at least one other value of the first attribute.
[0105] Selecting at least one other value of the first attribute may include selecting a next most common value of the at least one first attribute in the training dataset after the selected particular value.
[0106] Dividing each of the primary subsets corresponding to the selected values for the first attribute into a plurality of sub-subsets may include, for each primary subset corresponding to the selected values for the first attribute, dividing the primary subset into h sub-subsets, where h+1 is the number of primary subsets.
[0107] Dividing each of the primary subsets corresponding to the selected values for the first attribute into a plurality of sub-subsets may include, for each primary subset corresponding to the selected values for the first attribute, dividing the primary subset into a number of sub-subsets equal to the number of other primary subsets.
[0108] For each primary subset corresponding to a selected value for the first attribute, each sub-subset may correspond to one of the other primary subsets, and downsampling of each sub-subset may be performed with respect to the corresponding other primary subset.
[0109] For each primary subset corresponding to a selected value for the first attribute, the sub-subsets may correspond to respective other primary subsets, and downsampling of each sub-subset may be performed with respect to the corresponding other primary subset.
[0110] Dividing each of the primary subsets corresponding to the selected values for the first attribute into a plurality of sub-subsets may include dividing each primary subset uniformly.
[0111] Dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets may include, for each primary subset corresponding to selected values for the first attribute, dividing the primary subset into a plurality of sub-subsets each of size corresponding / proportional to the other primary subsets.
[0112] For each primary subset corresponding to a selected value for the first attribute, the corresponding sub-subsets may each be sized corresponding / proportionally to the other primary subsets.
[0113] For each primary subset corresponding to a selected value for the first attribute, the corresponding sub-subsets may each contain a number of data points corresponding / proportional to the other primary subsets.
[0114] Dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets may include using random sampling.
[0115] Generating the down-sampled training data set may include combining the down-sampled auxiliary subset with a primary subset other than the primary subset corresponding to the selected value of the first attribute.
[0116] For each data point in the sub-subset, calculating the average distance to the k furthest data points of the primary subset may include calculating a distance to each data point in the primary subset and determining the k furthest data points.
[0117] The average distance may include a Euclidean distance.
[0118] For each data point in the sub-subset, calculating an average distance (distance) to the k furthest data points of the primary subset for a plurality of attributes other than the at least first and second attributes may include calculating an average distance in feature / attribute space for a plurality of attributes other than the at least first and second attributes.
[0119] The at least first and second attributes may further include at least a third attribute.
[0120] Each of the second and third attributes may be a protected attribute.
[0121] The ML model may be configured to predict the first attribute based on the plurality of attributes other than at least the second and third attributes.
[0122] The computer-implemented method may include calculating a fairness metric for the downsampled training dataset; if the fairness metric does not meet a threshold fairness, for each primary subset corresponding to a selected value of a first attribute, further downsampling the plurality of sub-subsets relative to each other primary subset to generate a plurality of further down-sampled sub-subsets; and generating a further down-sampled training dataset for training a machine learning (ML) model to predict (a value of) the first attribute, the down-sampled training dataset including data points of the further down-sampled sub-subsets and data points of primary subsets other than the primary subset corresponding to the selected value of the first attribute.
[0123] The computer-implemented method may include iteratively downsampling the plurality of sub-subsets until the calculated fairness metric meets a threshold fairness.
[0124] The fairness index may include at least one of a statistical parity difference, a statistical parity ratio, an equal opportunity difference, an equal opportunity ratio, a mean / equalized odds difference, and a mean / equalized odds ratio.
[0125] The computer-implemented method may include calculating a ratio between the largest of the primary subsets and the smallest of the primary subsets (after downsampling); if the ratio does not meet a threshold ratio, for each primary subset corresponding to a selected value of (for) the first attribute, further downsampling the plurality of sub-subsets respectively relative to the other primary subsets to generate a plurality of further down-sampled sub-subsets; and generating a further down-sampled training dataset for training an ML model to predict (a value of) the first attribute, the further down-sampled training dataset including data points of the further down-sampled sub-subsets and data points of primary subsets other than the primary subset corresponding to the selected value of (for) the first attribute.
[0126] The computer-implemented method may include iteratively downsampling the multiple sub-subsets until the ratio meets a threshold ratio.
[0127] The training dataset may include medical data.
[0128] The training dataset may include medical data, where each data point in the training dataset relates to a human subject or patient.
[0129] The secondary attribute is one of the following: gender, race, religion, ethnicity, age(s), sex, pregnancy status, disability status, gender reassignment status, marital or civil partnership status, or sexual orientation.
[0130] The first attribute may be the presence of a disease or condition.
[0131] The first attribute may be the likelihood of the current or future existence of a disease or condition.
[0132] The second attribute may be gender and the first attribute may be the presence of diabetes.
[0133] The second attribute may be gender and the first attribute may be the presence of a disease or condition.
[0134] The ML model may be configured to predict (the value of) the first attribute based on multiple attributes other than at least the first and second attributes.
[0135] The computer-implemented method may further include training an ML model using the down-sampled training dataset.
[0136] The computer-implemented method may further include predicting (the value of) the first attribute for new data instances using the ML model.
[0137] The computer-implemented method may further include using the ML model to predict (the value of) the first attribute for a new human subject or patient.
[0138] The computer-implemented method may further include predicting the presence or absence of the disease using the ML model.
[0139] The computer-implemented method may further include outputting a diagnosis for the new human subject or patient, including a prediction of the presence or absence of the disease.
[0140] The computer-implemented method may further include using the ML model to predict the likelihood of the current or future presence of the disease or condition.
[0141] The training dataset may include medical data, each data point of the training dataset may be associated with a human subject or patient, and the first attribute may be the presence of a disease or condition; the computer-implemented method may include training an ML model using the down-sampled training dataset and using the ML model to predict the first attribute for a new human subject or patient; and the computer-implemented method may include outputting a diagnosis for the new human subject or patient, including a prediction of the presence or absence of the disease or condition.
[0142] Disclosed herein is a computer program (including instructions) that, when executed on a computer, causes the computer to perform a method, comprising: classifying each data point in a training dataset into one of a plurality of primary subsets based on values of the data point for (at least) a first and a second attribute, whereby each primary subset corresponds to a particular value for (at least) the first and second attributes, whereby, for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute, where each data point is defined by a plurality of attributes including the at least the first and second attributes; selecting a particular value for the first attribute and dividing each of the primary subsets corresponding to the selected value for the first attribute into a plurality of sub-subsets; and, for each of the primary subsets corresponding to the selected value for the first attribute, downsampling the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of downsampled sub-subsets. generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of a primary subset other than the primary subset corresponding to a selected value of (for) the first attribute, said downsampling including: calculating, for each data point in the sub-subset, an average distance (distance) to the k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the sub-subset) the n data points of the sub-subset having the largest calculated average distance (to each of the k furthest data points of the primary subset), to generate the downsampled sub-subset, where k and n are positive integers.
[0143] Disclosed herein is an information processing device comprising a memory and a processor connected to the memory, the processor being configured to: classify each data point in a training dataset into one of a plurality of primary subsets based on values of the data point for (at least) a first and a second attribute, whereby each primary subset corresponds to a particular value for (at least) the first and second attributes, whereby, for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute, where each data point is defined by a plurality of attributes including the at least the first and second attributes; select a particular value for the first attribute and divide each of the primary subsets corresponding to the selected value for (at least) the first attribute into a plurality of sub-subsets; and, for each of the primary subsets corresponding to the selected value for (at least) the first attribute, down-sample the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of down-sampled sub-subsets. generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of a primary subset other than the primary subset corresponding to a selected value of (for) the first attribute, said downsampling including: calculating, for each data point in the sub-subset, an average distance (distance) to k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the sub-subset) n data points of the sub-subset having the largest calculated average distance (to each of the k furthest data points of the primary subset), to generate the downsampled sub-subset, wherein k and n are positive integers.
[0144] It will be understood that step S10 may be considered to correspond to step S210 and / or step S1, step S20 to step S220 and / or step S4, step S30 to steps S231 and S232 and / or step S5, step S40 to steps S241 and S242 and / or steps S6 and S7, step S41 to step S310, step S42 to step S330, and step S43 to step S350. The description of any given step in the method of Figure 5 / 6 or 11 or 12 / 13 may apply to the corresponding step(s) in any other method.
[0145] Any of the methods of Figures 5 / 6 or 11 or 12 / 13 may be applied to a training dataset including medical data, and any of these methods may further include training an ML model using the downsampled training dataset as described above with respect to the method of Figures 12 / 13, and optionally predicting the presence or absence of disease using the trained ML model. A diagnosis may be output based on the prediction.
[0146] Figure 14 illustrates the results of evaluating ML models trained separately on datasets without downsampling and datasets with various downsampling procedures applied.
[0147] The dataset used as the original dataset is a standard benchmark dataset called the Adult Dataset (Adult - UCI Machine Learning Repository (https: / / archive.ics.uci.edu / dataset / 2 / adult)). The ML model classifies data as true or false, which in the context of the adult dataset means whether the income associated with the record is above a threshold amount. Each graph in Figure 14 shows the results of applying eight ML models (classification algorithms) to three datasets. The circles in the upper and lower graphs show the results of applying the ML models to the original dataset, and the triangles in the upper and lower graphs show the results of applying the ML models to datasets after fair downsampling (i.e., downsampling according to the methods in Figures 5 / 6, 11, and 12 / 13). The squares in the top three graphs show the results of applying the ML model to the dataset after downsampling according to a method described below, called the modified comparison method, while the squares in the bottom three graphs show the results of applying the ML model to the dataset after "random fair downsampling." "Random fair downsampling" is a downsampling method that divides the dataset into clusters / subsets based on groups and classes, but then uses random downsampling for each "majority class" subset rather than using the distance-based method of "fair downsampling." For all downsampling methods used to obtain the results in Figure 14, the "amount of downsampling" was 0.5, meaning that half of the points corresponding to the majority class were discarded.
[0148] The ML models (classifiers) evaluated are as follows: LogisticRegression (https: / / scikit-learn.org / stable / modules / generated / sklearn.linear_model.LogisticRegression.html), ·SVC(https: / / scikit-learn.org / stable / modules / generated / sklearn.svm.SVC.html), RandomForestClassifier (https: / / scikit-learn.org / stable / modules / generated / sklearn.ensemble.RandomForestClassifier.html), · KNeighborsClassifier (https: / / scikit-learn.org / stable / modules / generated / sklearn.neighbors.KNeighborsClassifier.html), ·XGBClassifier [XGB classifier] (https: / / github.com / dmlc / xgboost), ·GaussianNB, [GaussianNB] (https: / / scikit-learn.org / stable / modules / generated / sklearn.naive_bayes.GaussianNB.html), GradientBoostingClassifier (https: / / scikit-learn.org / stable / modules / generated / sklearn.ensemble.GradientBoostingClassifier.html), DecisionTreeClassifier (https: / / scikit-learn.org / stable / modules / generated / sklearn.tree.DecisionTreeClassifier.html).
[0149] The graph on the left shows the statistical parity difference for accuracy, the middle graph shows the equal chance difference for accuracy, and the right graph shows the mean odds difference for accuracy. Accuracy was measured using a metric called "balanced accuracy," which is appropriate for dealing with imbalanced datasets. Balanced accuracy = (1 / 2)(TP / (TP+FN)+TN / (TN+FP))
[0150] It will be seen that fair downsampling improved the fairness of the classifier in most, but not all, cases, where fairness is measured by one of the quantities shown on the y-axis of the graph in Figure 14. Furthermore, accuracy generally tends to improve. Measures of statistical parity show the greatest improvement when fair downsampling is used compared to no downsampling or random downsampling.
[0151] Some general observations can be made (naturally, results will depend somewhat on the data set used, and the following observations are indications and trends, not rules).
[0152] When the dataset is downsampled using random downsampling (method of comparison): a) There is a trade-off between accuracy and fairness. b) After downsampling, accuracy increases by about 1-5% most of the time, but sometimes decreases by a small amount. c) After downsampling, fairness almost always decreases by about 5-20%.
[0153] When a dataset is downsampled using unbiased downsampling (i.e., downsampling according to the methods in Figures 5 / 6, 11, and 12 / 13): a) There is a significant improvement in fairness compared to traditional downsampling methods. This is even more evident in the case of "statistical parity difference" as shown in the left graph of Figure 14, where fairness can increase by 40% in some cases. b) Accuracy is not substantially reduced, and in some cases is improved compared to the accuracy before downsampling. The improvement in accuracy is comparable to that of "random downsampling."
[0154] Aspects disclosed herein include the following methods. 1. Divide a given dataset D into groups Gi and classes Ci. Consider a binary classification problem with one protected group (generalization to two or more protected groups is straightforward). 2. Let M1 and M2 be the majority classes of groups 1 and 2, respectively. 3. Let m1 and m2 be the minority classes in groups 1 and 2, respectively. 4. Divide M1 into three random, non-overlapping sets, S1, S2, and S3. The union of the three sets is M1. The sizes of the three sets are proportional to the sizes of m1, m2, and M2, respectively. 5. Downsample M1 in the pairs (S1,m1), (S2,,m2), (S3,M2). For the pair (S1,m1), the downsampling of S1 is as follows: Calculate the average distance between each of the samples in S1 and the n=3 farthest samples in m1. For this step, the KNN algorithm is used. Keep only the samples in S1 with the smallest average distance. S2 and S3 are downsampled in the same way with respect to m2 and M2, respectively. 6. Similarly, divide M2 into three random sets and downsample with respect to m1, m2, and M.
[0155] The comparative method described above with respect to Figure 2, hereafter sometimes referred to as random downsampling, involves randomly removing samples from the majority class. It does not consider the boundaries between classes or groups. Therefore, it can lead to the removal of samples near the boundary with the same probability as samples from the interior. This affects the decision boundary and, consequently, the accuracy and fairness of the resulting classifier trained on the downsampled dataset. This can lead to underfitting.
[0156] A simple approach to overcome these problems may be to retain more samples near the boundary by employing a distance-based downsampling approach. This is referred to here and above as the modified comparison method. In this case, samples with the smallest average distance from the n=3 furthest points of the minority class = 3 of the minority class are retained. However, this simple approach does not consider the decision boundary with respect to groups, e.g., privileged and non-privileged groups. The computation time / load is large and increases with the size of the dataset (because with more data points, more distances between points must be calculated). The memory required for such an operation is large.
[0157] The fair downsampling methods disclosed herein (i.e., the methods of Figures 5 / 6, 11, 12, and 13) reduce the size of a dataset without sacrificing fairness and accuracy by considering all possible boundaries between subsets classified based on groups and classes during downsampling. In fact, fairness is improved compared to traditional downsampling techniques, while accuracy, as described above, does not substantially decrease and may even increase. By considering boundaries associated with different group and class combinations, the problem of underfitting is overcome.
[0158] Furthermore, the amount of memory / processing power / computational load / computation time required is reduced when using the fair downsampling method disclosed herein (i.e., the methods of FIGS. 5 / 6, 11, 12, and 13) compared to a simple approach involving KNN (especially when the dataset is large (approximately 100k samples / records)). This is because the subsets (e.g., M1 and M2) are divided into sub-subsets with smaller sizes, and each of these sub-subsets is compared to one other subset. Therefore, compared to, for example, a modified comparison method, fewer distances between pairs of points need to be considered. Thus, using the methods disclosed herein, it is possible to downsample larger datasets with the same memory / processing power / computational load / computation time. Compared to a simple approach (modified comparison method) involving the use of KNN, faster performance is achieved using the methods disclosed herein.
[0159] Medical applications (e.g., outputting a prediction of the presence or absence of a disease) are mentioned above as uses of ML models for which the training data is downsampled. Other scenarios, such as credit lending analysis (see below), employee performance evaluation (see below), shortlisting candidates for school admissions (secured attributes: parental education level, zip code), or shortlisting candidates for jobs (secured attributes: gender), are of course applicable.
[0160] Credit analysis: The field of application concerns the banking sector. Banks want to analyze the creditworthiness of prospective borrowers, for example, how likely they are to repay interest. Protected attributes can be, for example, nationality, marital status, educational background, and gender. Employee performance evaluation: This is an imbalance issue as only a few employees are scored as excellent. Protected attribute: Gender in most cases.
[0161] 15 is a block diagram of an information processing apparatus 10 or computing device 10, such as a data storage server, that may be used to embody the present invention, to implement some or all of the operations of the methods embodying the present invention, and to perform some or all of the tasks of the apparatus of one embodiment. The computing device 10 may be used to perform any of the method steps described above, for example, any of steps S110-S150, S210-S242, S310-S350, S1-S9, S10-S50, and S41-S46.
[0162] Computing device 10 comprises a processor 993 and memory 994. Optionally, the computing device also includes a network interface 997 for communicating with other such computing devices, such as other computing devices of embodiments of the invention. Optionally, the computing device also includes one or more input mechanisms, such as a keyboard and mouse 996, and one or more display units, such as a monitor or monitors 995. These elements can facilitate user interaction. The components can be connected to each other via a bus 992.
[0163] The memory 994 may include a computer-readable medium, which term may refer to a single medium or multiple media (e.g., centralized or distributed databases and / or associated caches and servers) configured to carry computer-executable instructions. Computer-executable instructions may include, for example, instructions and data that are accessible by a computer (e.g., one or more processors) and cause the computer to perform one or more functions or operations. For example, the computer-executable instructions may include instructions for implementing a method disclosed herein or any of the method steps disclosed herein, e.g., steps S110-S150, S210-S242, S310-S350, S1-S9, S10-S50, and S41-S46. Thus, the term "computer-readable storage medium" may also include any medium capable of storing, encoding, or carrying a set of instructions for execution by a machine, and causing a machine to perform any one or more of the method steps of the present disclosure. Accordingly, the term "computer-readable storage medium" may be interpreted to include, but is not limited to, solid-state memory, optical media, and magnetic media. By way of example and not limitation, such computer-readable media may include non-transitory computer-readable storage media including random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory devices (e.g., solid-state memory devices).
[0164] The processor 993 is configured to control the computing device and perform processing operations, for example, executing computer program code stored in the memory 994 to perform any of the method steps described herein. The memory 994 stores data read and written by the processor 993, and may store training data and / or ML model weights and / or information regarding protected attributes and / or subsets and / or auxiliary subsets and / or threshold information and / or formula (e) for calculating a fairness metric and / or distance metrics and / or downsampled auxiliary subsets and / or downsampled training datasets and / or diagnostic information and / or ML model predictions and / or test data and / or input data and / or other data described above, and / or programs for performing any of the method steps described above. As referred to herein, a processor may include one or more general-purpose processing devices, such as a microprocessor, a central processing unit, etc. The processor may include a complex instruction set computing (CISC) microprocessor, a reduced instruction set computing (RISC) microprocessor, a very long instruction word (VLIW) microprocessor, or a processor implementing other instruction sets or combinations of instruction sets. The processor may also include one or more special-purpose processing devices, such as an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), a network processor, or the like. In one or more embodiments, the processor is configured to execute the operations and instructions for performing the operations described herein. The processor 993 may be considered to include any of the modules described above. Any operation described as being implemented by a module may be implemented as a method by a computer, for example, by the processor 993.
[0165] The display unit 995 may display representations of data stored by the computing device, such as a representation of points to be retained / discarded in downsampling, and / or ML model predictions, and / or GUI windows, and / or interactive representations that allow a user to interact with apparatus 10, for example by drag-and-drop or selection interactions, and / or any other output described above, and may also display cursors and dialog boxes and screens that allow interaction between a user and programs and data stored on the computing device. The input mechanism 996 may allow a user to input data and instructions into the computing device, such as allowing a user to enter any user input described above.
[0166] The network interface (network I / F) 997 may be connected to a network such as the Internet and can be connected to other such computing devices via the network. The network I / F 997 can control the input and output of data to and from other devices via the network. Other peripheral devices may be included in the computing device, such as a microphone, speakers, printer, power supply unit, fan, case, scanner, trackball, etc.
[0167] A method embodying the present invention (e.g., any of steps S110-S150, S210-S242, S310-S350, S1-S9, S10-S50, and S41-S46) may be performed on a computing device / apparatus 10 such as that shown in FIG. 15. Such a computing device need not have all of the components shown in FIG. 15 and may be composed of a subset of those components. For example, apparatus 10 may include a processor 993 and a memory 994 connected to the processor 993. Alternatively, apparatus 10 may include a processor 993, a memory 994 connected to the processor 993, and a display 995. A method embodying the present invention may be performed by a single computing device that communicates with one or more data storage servers via a network. The computing device may also be a data storage device itself that stores at least a portion of the data.
[0168] Methods embodying the present invention may be performed by a plurality of computing devices operating in cooperation with one another, one or more of which may be data storage servers that store at least a portion of the data.
[0169] A computing device 10 may have multiple processors, or a processor logically separated into multiple virtual processors. The methods disclosed herein may be performed using such multiple processors or virtual processors, or using multiple computing devices 10. Downsampling of auxiliary data sets may be performed in parallel using multiple computing devices 10 or multiple processors or multiple virtual processors. Multiple processors or virtual processors (or processors residing on different computing devices 10) may have different sizes / capacities, and downsampling of auxiliary subsets may be assigned to processors / virtual processors / computing devices according to the size of the auxiliary subsets, thereby, for example, allowing a larger auxiliary data set to be downsampled (in parallel) using a processor / virtual processor with a larger / higher capacity.
[0170] The invention may be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. The invention can also be implemented as a computer program or computer program product, i.e., a computer program tangibly embodied in a non-transitory information carrier, for example a machine-readable storage device or a propagated signal, for execution by, or to control the operation of, one or more hardware modules.
[0171] A computer program may be in the form of a stand-alone program, a computer program portion, or two or more computer programs, may be written in any form of programming language, including compiled or interpreted languages, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a data processing environment. A computer program may be deployed to be executed on one module or on multiple modules at one site, or may be distributed across multiple sites and interconnected by a communications network.
[0172] The method steps of the present invention (e.g., any of steps S110-S150, S210-S242, S310-S350, S1-S9, S10-S50, and S41-S46) may be performed by one or more programmable processors executing computer programs to perform the functions of the present invention by operating on input data and generating output. Apparatus of the present invention may be implemented as programmed hardware or as special purpose logic circuitry including, for example, an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
[0173] Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor receives instructions and data from a read-only memory or a random-access memory or both. The essential elements of a computer are a processor for executing instructions coupled to one or more memory devices for storing instructions and data.
[0174] The above-described embodiments of the invention may be advantageously used independently of other embodiments or in any feasible combination with one or more other embodiments.
[0175] The present disclosure extends to the following statements:
[0176] S1. A computer-implemented method, the method comprising: classifying each data point in the training dataset into one of a plurality of primary subsets based on the data point's values for (at least) first and second attributes, whereby each primary subset corresponds to a particular value for (at least) said first and second attributes, whereby for each primary subset, the data points in the subset share the same value for the first attribute and the same value for the second attribute, whereby each data point is defined by (values for) a plurality of attributes including said at least first and second attributes; selecting particular values for the first attribute and dividing each of the primary subsets corresponding to the selected values of the first attribute into a plurality of sub-subsets; for each of the primary subsets corresponding to a selected value of the first attribute, downsampling the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of downsampled sub-subsets; generating a downsampled training dataset for training a machine learning (ML) model to predict (a value of) the first attribute, the downsampled training dataset comprising data points of the downsampled sub-subset and data points of the primary subset other than the primary subset corresponding to a selected value of (for) the first attribute, wherein the downsampling comprises: For each data point in the sub-subset, calculate an average distance (distance) to the k furthest data points in the primary subset for the plurality of attributes other than the at least first and second attributes; removing (from the sub-subset) the n data points of the sub-subset that have the largest calculated average distances (to the k furthest data points of each of the primary subset), to generate the down-sampled sub-subset, where k and n are positive integers; A method comprising: S2. The computer-implemented method of statement S1, wherein the second attribute is a protected attribute. S3. The computer-implemented method of statement S1 or S2, wherein the ML model is configured to predict the first attribute based on the plurality of attributes other than at least the second attribute. S4. The computer-implemented method of any one of statements S1-S3, wherein the first attribute for a given data point comprises one of two values. S5. The computer-implemented method of any one of statements S1 to S4, wherein the ML model is configured to classify data points with respect to the first attribute. S6. The computer-implemented method of any one of statements S1 to S4, wherein the ML model is configured to classify data points with respect to the first attribute, and the classification comprises binary classification. S7. The computer-implemented method of any one of statements S1 to S6, wherein selecting the particular value for the first attribute includes selecting a majority value for the first attribute when the training dataset is imbalanced with respect to the first attribute, the majority value being the most common value in the training dataset with respect to the first attribute. S8. The computer-implemented method of any one of statements S1 to S6, wherein selecting the particular value for the first attribute includes selecting a majority value for the first attribute if a majority value for the first attribute exists, the majority value being the most common value in the training dataset for the first attribute. S9. The computer-implemented method of any one of statements S1 to S6, wherein selecting the particular value for the first attribute includes selecting the most common value in the training dataset for the first attribute when the training dataset is imbalanced with respect to the first attribute. S10. The computer-implemented method of any one of statements S1 to S9, including selecting at least one other value of the first attribute; and for each selected at least one other value of the first attribute, dividing each of the primary subsets corresponding to the selected other value of the first attribute into a plurality of further sub-subsets; and down-sampling the further sub-subsets, wherein the down-sampled training data set includes data points of the down-sampled sub-subsets, data points of the down-sampled further sub-subsets, and data points of the primary subsets other than the primary subset corresponding to the selected value of the first attribute and the primary subset corresponding to the selected at least one other value of the first attribute. S11. The computer-implemented method of statement S10, wherein selecting the at least one other value of the first attribute comprises selecting, within the training data set, the next most common value of the at least one first attribute after the selected particular value. S12. The computer-implemented method of any one of statements S1 to S11, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets includes, for each primary subset corresponding to selected values for the first attribute, dividing the primary subset into h sub-subsets, where h+1 is the number of primary subsets. S13. The computer-implemented method of any one of statements S1 to S11, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets includes, for each primary subset corresponding to selected values for the first attribute, dividing the primary subset into a number of sub-subsets equal to the number of other primary subsets. S14. The computer-implemented method of any one of statements S1 to S13, wherein for each of the primary subsets corresponding to a selected value for the first attribute, each sub-subset corresponds to one of the other primary subsets, and downsampling of each sub-subset is performed with respect to the corresponding other primary subset. S15. The computer-implemented method of any one of statements S1 to S13, wherein for each of the primary subsets corresponding to a selected value for the first attribute, the sub-subsets correspond respectively to other primary subsets, and downsampling of each sub-subset is performed with respect to the corresponding other primary subset. S16. The computer-implemented method of any one of statements S1 to S16, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets includes uniformly dividing each primary subset. S17. The computer-implemented method of any one of statements S1 to S15, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets includes, for each primary subset corresponding to selected values for the first attribute, dividing the primary subset into the plurality of sub-subsets each of sizes corresponding to / proportional to other primary subsets. S18. The computer-implemented method of any one of statements S1 to S15, wherein for each of the primary subsets corresponding to a selected value for the first attribute, corresponding sub-subsets are sized corresponding to / proportional to each other primary subset. S19. The computer-implemented method of any one of statements S1 to S15, wherein for each of the primary subsets corresponding to a selected value for the first attribute, the corresponding sub-subsets each include a number of data points corresponding / proportional to the other primary subsets. S20. The computer-implemented method of any one of statements S1 to S19, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets includes using random sampling. S21. The computer-implemented method of any one of statements S1 to S20, wherein generating the down-sampled training data set includes combining the down-sampled auxiliary subset with a primary subset other than the primary subset corresponding to the selected value of the first attribute. S22. The computer-implemented method of any one of statements S1 to S21, wherein calculating, for each data point in the sub-subset, an average distance to the k furthest data points of the primary subset includes calculating a distance to each data point in the primary subset to determine the k furthest data points. S23. The computer-implemented method of any one of statements S1 to S22, wherein the average distance comprises a Euclidean distance. S24. The computer-implemented method of any one of statements S1 to S23, wherein calculating, for each data point in the sub-subset, an average distance (distance) to the k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes comprises calculating an average distance in feature / attribute space for the plurality of attributes other than the at least first and second attributes. S25. The computer-implemented method of any one of statements S1 to S24, wherein the at least first and second attributes further include at least a third attribute. S26. The computer-implemented method of statement S25, wherein each of the second and third attributes is a protected attribute. S27. The computer-implemented method of statement S25 or S26, wherein the ML model is configured to predict the first attribute based on the plurality of attributes other than at least the second and third attributes. S28. The computer-implemented method of any one of statements S1 to S27, comprising: calculating a fairness metric for the down-sampled training dataset; and if the fairness metric does not meet a threshold fairness, for each of the primary subsets corresponding to selected values of the first attribute, further down-sampling the plurality of sub-subsets with respect to each other primary subset to generate a plurality of further down-sampled sub-subsets; and generating a further down-sampled training dataset for training a machine learning (ML) model to predict (values of) the first attribute, the down-sampled training dataset including data points of the further down-sampled sub-subsets and data points of the primary subsets other than the primary subset corresponding to the selected values of the first attribute. S29. The computer-implemented method of statement S28, wherein the computer-implemented method includes iteratively downsampling the plurality of sub-subsets until a calculated fairness metric meets the threshold fairness. S30. The computer-implemented method of statement S28 or S29, wherein the fairness metric comprises at least one of a statistical parity difference, a statistical parity ratio, an equal opportunity difference, an equal opportunity ratio, a mean / equalized odds difference, and a mean / equalized odds ratio. S31. The computer-implemented method of any one of statements S1 to S30, comprising: calculating a ratio between the largest of the primary subsets (after downsampling) and the smallest of the primary subsets; and if the ratio does not satisfy a threshold ratio, for each of the primary subsets corresponding to selected values of the first attribute, further downsampling the plurality of sub-subsets respectively with respect to other primary subsets to generate a plurality of further down-sampled sub-subsets; and generating a further down-sampled training dataset for training the ML model to predict (the value of) the first attribute, the further down-sampled training dataset including data points of the further down-sampled sub-subsets and data points of primary subsets other than the primary subset corresponding to the selected value of the first attribute. S32. The computer-implemented method of statement S31, wherein the computer-implemented method includes iteratively downsampling the plurality of sub-subsets until the ratio satisfies the threshold ratio. S33. The computer-implemented method of any one of statements S1 to S32, wherein the training data set includes medical data. S34. The computer-implemented method of any one of statements S1 to S32, wherein the training dataset includes medical data and each data point in the training dataset relates to a human subject or patient. S35. The computer-implemented method of any one of statements S1 to S34, wherein the second attribute is one of gender, race, religion, ethnicity, age(s), sex, pregnancy status, disability status, gender reassignment status, marital status, civil partnership status, and sexual orientation. S36. The computer-implemented method of any one of statements S1 to S35, wherein the first attribute is the presence of a disease or condition. S37. The computer-implemented method of any one of statements S1 to S35, wherein the first attribute is the likelihood of the current or future existence of a disease or condition. S38. The computer-implemented method of any one of statements S1 to S37, wherein the second attribute is gender and the first attribute is the presence of diabetes. S39. The computer-implemented method of any one of statements S1 to S37, wherein the second attribute is gender and the first attribute is the presence of a disease or condition. S40. The computer-implemented method of any one of statements S1 to S39, wherein the ML model is configured to predict (the value of) the first attribute based on multiple attributes other than the at least first and second attributes. S41. The computer-implemented method of any one of statements S1 to S40, wherein the computer-implemented method further includes training the ML model using a downsampled training dataset. S42. The computer-implemented method of any one of statements S1 to S41, wherein the computer-implemented method further comprises using the ML model to predict (the value of) the first attribute for new data instances. S43. The computer-implemented method of any one of statements S1 to S42, wherein the computer-implemented method further comprises using the ML model to predict (the value of) the first attribute for a new human subject or patient. S44. The computer-implemented method of any one of statements S1 to S43, wherein the computer-implemented method further includes using the ML model to predict the presence or absence of disease. S45. The computer-implemented method of statement S44, wherein the computer-implemented method further includes outputting a diagnosis for the new human subject or patient, the diagnosis including a prediction of the presence or absence of the disease. S46. The computer-implemented method of any one of statements S1 to S43, wherein the computer-implemented method further includes using the ML model to predict the likelihood of current or future presence of a disease or condition. S47. The computer-implemented method of any one of statements S1 to S32, wherein the training dataset comprises medical data, each data point of the training dataset relates to a human subject or patient, and the first attribute is the presence of a disease or condition, the computer-implemented method comprises training the ML model using a down-sampled training dataset and using the ML model to predict the first attribute for a new human subject or patient, and the computer-implemented method comprises outputting a diagnosis for the new human subject or patient, the diagnosis comprising a prediction of the presence or absence of the disease or condition. S48. A computer program (including instructions) that, when executed on a computer, causes the computer to perform a method, comprising: classifying each data point in a training data set into one of a plurality of primary subsets based on values of the data point for (at least) first and second attributes, whereby each primary subset corresponds to a particular value of (at least) the first and second attributes, whereby, for each primary subset, data points within the subset share the same value for the first attribute and the same value for the second attribute, where each data point is defined by a plurality of attributes including the at least first and second attributes; selecting a particular value for the first attribute and dividing each of the primary subsets corresponding to the selected value of (at least) the first attribute into a plurality of sub-subsets; and for each of the primary subsets corresponding to the selected value of (at least) the first attribute, downsampling each of the sub-subsets with respect to each of the other primary subsets. generating a plurality of downsampled sub-subsets; and generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of primary subsets other than the primary subset corresponding to selected values of (for) the first attribute, wherein the downsampling includes: calculating, for each data point in the sub-subset, an average distance (distance) to the k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the sub-subset) the n data points of the sub-subset having the largest calculated average distance (to each of the k furthest data points of the primary subset), to generate the downsampled sub-subset, where k and n are positive integers. S49. An information processing apparatus comprising a memory and a processor connected to the memory, the processor: classifying each data point in a training dataset into one of a plurality of primary subsets based on values of the data point for (at least) first and second attributes, whereby each primary subset corresponds to a particular value for (at least) the first and second attributes, whereby, for each primary subset, data points within the subset share the same value for the first attribute and the same value for the second attribute, where each data point is defined by a plurality of attributes including the at least first and second attributes; selecting a particular value for the first attribute and dividing each of the primary subsets corresponding to the selected value for (at least) the first attribute into a plurality of sub-subsets; and for each of the primary subsets corresponding to the selected value for (at least) the first attribute, down-sampling the plurality of sub-subsets with respect to each other primary subset to form a plurality of down-sampling sub-subsets. generating a downsampled sub-subset; and generating a downsampled training dataset for training a machine learning (ML) model to predict (the value of) the first attribute, the downsampled training dataset including data points of the downsampled sub-subset and data points of a primary subset other than the primary subset corresponding to a selected value of (for) the first attribute, wherein the downsampling includes: calculating, for each data point in the sub-subset, an average distance (distance) to k furthest data points of the primary subset for the plurality of attributes other than the at least first and second attributes; and removing (from the sub-subset) n data points of the sub-subset having the largest calculated average distance (to each of the k furthest data points of the primary subset), to generate the downsampled sub-subset, where k and n are positive integers. [Explanation of symbols]
[0177] S110 Training Set S120 Test Set S130 Fair Downsampling Train the S140 classifier S150 evaluation S210 Dataset D is group G i and Class G i Divide into S220 For protection group i, the majority class and minority class M i ,m i Identify S231 M i Let m1, m2, and M2 be three random, non-overlapping sets S i Divide into S232 M2 is a set of three random i Divide into S241 Downsample the pairs (S1,m1), (S2,m2), (S3,M2) S242 Downsample the pairs (T1,m1), (T2,m2), (T3,M1) S310 Pair (S,m) to be downsampled S320s i Select ∈S S330s i The average distance d between m and the n=3 most distant samples i Calculate using KNN S340 All distances d i form a set of S350 minimum d i Store samples with S1 Input data into groups and class clusters C y,s Divide into S2 Each cluster C y,s Calculating the size of S3 M=max y,s |C y,s |, m=min y,s |C y,s|, S4 Cluster C to be downsampled i Selection of S5 Random Sampling i ∪ k C i k =C i Divide into S6 Cluster C j ≠C i Selection of S7 C j Regarding C i k=1 Downsample S8 Calculate fairness f S9 Increase downsampling S10 Classify the training dataset into multiple primary subsets S20 Select the value of the first attribute S30 Divide each primary subset corresponding to the selected value into sub-subsets S40 For each primary subset corresponding to the selected value, downsample the sub-subset with respect to each of the other primary subsets to generate a downsampled sub-subset. Generate a downsampled training dataset for S50 S41 Select auxiliary subset S42 For each data point in the secondary subset, calculate the average distance to the k farthest data points in the corresponding primary subset. S43 Receive the n data points with the largest average distance S44 Are there any auxiliary subsets remaining that have not been downsampled? S45 End
Claims
1. 1. A computer-implemented method, the method comprising: classifying each data point in the training dataset into one of a plurality of primary subsets based on the data point's values for at least first and second attributes, such that each primary subset corresponds to a particular value of at least said first and second attributes, each data point being defined by a plurality of attributes including said at least first and second attributes; selecting particular values for the first attribute and dividing each of the primary subsets corresponding to the selected values of the first attribute into a plurality of sub-subsets; for each of the primary subsets corresponding to selected values of the first attribute, downsampling the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of downsampled sub-subsets; generating a down-sampled training dataset for training a machine learning (ML) model to predict the first attribute, the down-sampled training dataset including data points of the down-sampled sub-subset and data points of a primary subset other than the primary subset corresponding to the selected value of the first attribute, wherein the down-sampling includes: For each data point in the sub-subset, calculate an average distance (distance) to the k most distant data points in the primary subset for the plurality of attributes other than the at least first and second attributes; removing n data points of the sub-subset having the largest calculated average distance to generate the down-sampled sub-subset, where k and n are positive integers; A computer-implemented method comprising:
2. 2. The computer-implemented method of claim 1, wherein selecting the particular value for the first attribute comprises selecting the most common value in the training dataset for the first attribute when the training dataset is imbalanced with respect to the first attribute.
3. 3. The computer-implemented method of claim 1, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets comprises, for each primary subset corresponding to the selected values for the first attribute, dividing the primary subset into a number of sub-subsets equal to the number of other primary subsets.
4. 3. The computer-implemented method of claim 1, wherein dividing each of the primary subsets corresponding to selected values for the first attribute into a plurality of sub-subsets comprises, for each primary subset corresponding to the selected values for the first attribute, dividing the primary subset into the plurality of sub-subsets, each of which is proportional in size to the other primary subsets.
5. 3. The computer-implemented method of claim 1, wherein for each of the primary subsets corresponding to the selected value for the first attribute, the corresponding sub-subsets each include a number of data points proportional to the other primary subsets.
6. The computer-implemented method includes: calculating a fairness metric for the downsampled training dataset; if the fairness metric does not meet a threshold fairness, for each of the primary subsets corresponding to the selected value of the first attribute, further down-sampling the plurality of sub-subsets with respect to each other primary subset to generate a plurality of further down-sampled sub-subsets; generating a further down-sampled training dataset for training the ML model to predict the first attribute, the down-sampled training dataset including data points from the further down-sampled sub-set and data points from a primary subset other than the primary subset corresponding to the selected value of the first attribute; The computer-implemented method of claim 1 or 2, further comprising:
7. The computer-implemented method includes: calculating a ratio between the largest of the primary subset and the smallest of the primary subset after downsampling; if the ratio does not satisfy a threshold ratio, for each of the primary subsets corresponding to the selected value of the first attribute, further downsampling the plurality of sub-subsets with respect to other primary subsets to generate a plurality of further down-sampled sub-subsets; generating a further down-sampled training dataset for training the ML model to predict the first attribute, the further down-sampled training dataset including data points of the further down-sampled sub-subset and data points of a primary subset other than the primary subset corresponding to the selected value of the first attribute; The computer-implemented method of claim 1 or 2, further comprising:
8. 3. The computer-implemented method of claim 1 or 2, wherein the training dataset comprises medical data, and each data point in the training dataset relates to a human subject or patient.
9. The computer-implemented method of claim 1 or 2, wherein the first attribute is the presence of a disease or condition.
10. 3. The computer-implemented method of claim 1 or 2, further comprising training the ML model using a downsampled training dataset.
11. 11. The computer-implemented method of claim 10, further comprising using the ML model to predict the first attribute for new data instances.
12. 11. The computer-implemented method of claim 10, further comprising using the ML model to predict the presence or absence of a disease or condition.
13. 3. The computer-implemented method of claim 1, wherein the training dataset comprises medical data, each data point of the training dataset relates to a human subject or patient, and the first attribute is the presence of a disease or condition, the computer-implemented method comprises training the ML model using the down-sampled training dataset and using the ML model to predict the first attribute for a new human subject or patient, and the computer-implemented method comprises outputting a diagnosis for the new human subject or patient, the diagnosis comprising a prediction of the presence or absence of the disease or condition.
14. A computer program product which, when executed on a computer, causes the computer to carry out a method, the method comprising: classifying each data point in the training dataset into one of a plurality of primary subsets based on the data point's values for at least first and second attributes, such that each primary subset corresponds to a particular value of at least said first and second attributes, each data point being defined by a plurality of attributes including said at least first and second attributes; selecting particular values for the first attribute and dividing each of the primary subsets corresponding to the selected values of the first attribute into a plurality of sub-subsets; for each of the primary subsets corresponding to selected values of the first attribute, downsampling the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of downsampled sub-subsets; generating a down-sampled training dataset for training a machine learning (ML) model to predict the first attribute, the down-sampled training dataset including data points from the down-sampled sub-subset and data points from a primary subset other than the primary subset corresponding to selected values of the first attribute; The downsampling step comprises: for each data point in the sub-subset, calculating an average distance to the k furthest data points in the primary subset for the plurality of attributes other than the at least first and second attributes; removing n data points of the sub-subset having the largest calculated average distance to generate the down-sampled sub-subset, where k and n are positive integers; Computer program.
15. An information processing device comprising a memory and a processor connected to the memory, the processor: classifying each data point in the training dataset into one of a plurality of primary subsets based on the data point's values for at least first and second attributes, such that each primary subset corresponds to a particular value of at least said first and second attributes, each data point being defined by a plurality of attributes including said at least first and second attributes; selecting particular values for the first attribute and dividing each of the primary subsets corresponding to the selected values of the first attribute into a plurality of sub-subsets; for each of the primary subsets corresponding to selected values of the first attribute, downsampling the plurality of sub-subsets with respect to each of the other primary subsets to generate a plurality of downsampled sub-subsets; generating a down-sampled training dataset for training a machine learning (ML) model to predict the first attribute, the down-sampled training dataset including data points from the down-sampled sub-subset and data points from a primary subset other than the primary subset corresponding to selected values of the first attribute; The downsampling step comprises: for each data point in the sub-subset, calculating an average distance to the k furthest data points in the primary subset for the plurality of attributes other than the at least first and second attributes; removing n data points of the sub-subset having the largest calculated average distance to generate the down-sampled sub-subset, where k and n are positive integers; 20. An apparatus configured to: