<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Blackbox Postprocessing for Multiclass Fairness</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Preston Putzel</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Scott Lee</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centers for Disease Control and Prevention</institution>
          ,
          <addr-line>1600 Clifton Rd., Atlanta, GA</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Department of Computer Science, University of California</institution>
          ,
          <addr-line>Irvine, CA, 92697</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Applying standard machine learning approaches for classification can produce unequal results across different demographic groups. When then used in real-world settings, these inequities can have negative societal impacts. This has motivated the development of various approaches to fair classification with machine learning models in recent years. In this paper, we consider the problem of modifying the predictions of a blackbox machine learning classifier in order to achieve fairness in a multiclass setting. To accomplish this, we extend the 'post-processing' approach in Hardt, Price, and Srebro (2016), which focuses on fairness for binary classification, to the setting of fair multiclass classification. We explore when our approach produces both fair and accurate predictions through systematic synthetic experiments and also evaluate discrimination-fairness tradeoffs on several publicly available real-world application datasets. We find that overall, our approach produces minor drops in accuracy and enforces fairness when the number of individuals in the dataset is high relative to the number of classes and protected groups.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        As machine learning begins moving into sensitive
predictions tasks, it becomes critical to ensure the fair performance
of prediction models. Naively trained machine learning
systems can replicate biases present in their training data,
resulting in unfair outcomes that can accentuate societal
inequities. For example, machine learning systems have been
discovered to be unfair in predicting time to criminal
recidivism
        <xref ref-type="bibr" rid="ref4">(Dieterich, Mendoza, and Brennan 2016)</xref>
        , ranking
applications to nursing school
        <xref ref-type="bibr" rid="ref10 ref17 ref7">(Romano, Bates, and Cande`s
2020)</xref>
        , and recognizing faces
        <xref ref-type="bibr" rid="ref1 ref8">(Buolamwini and Gebru 2018)</xref>
        .
Most prior work in this area has focused on ensuring fairness
for binary outcomes. However, there are many important
real-world applications with multiclass outcomes instead.
For example, a self-driving car will need to be able to
distinguish clearly between humans, non-human animals (such
as dogs), and non-sentient objects while nonetheless
maintaining fair performance for both wheelchair users and
nonwheelchair users. Most work has also been done with the
*These authors contributed equally.
      </p>
      <p>Copyright © 2022 for this paper by its authors. Use permitted
under Creative Commons License Attribution 4.0 International (CC
BY 4.0).
assumption that model parameters are accessible to the
algorithm, but there is increasing availability of powerful
blackbox models whose internal parameters can be either
inaccessible or too costly to train. In this paper, we address the case
where outcomes are multiclass and the user has received a
pre-trained blackbox model. The main contributions of our
work are as follows:
• We show how to extend Hardt, Price, and Srebro (2016)
to multiclass outcomes.
• We demonstrate in what data regimes multiclass
postprocessing is likely to produce fair, useful, and accurate
results via a set of rigorous synthetic experiments.
• We demonstrate the results of our post-processing
algorithm on publicly available real-world applications.</p>
      <sec id="sec-1-1">
        <title>Code and Dataset Availability All of the code used to</title>
        <p>produce our experimental results as well as the synthetic and
real-world datasets can be found on our github page1.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Technical Approach</title>
      <p>As in Hardt, Price, and Srebro (2016), we consider the
problem of enforcing fairness on a blackbox classifier without
changing its internal parameters. This means that our
approach only has access to the predicted labels y^i from the
blackbox classifier, the true labels yi, and the protected
attributes ai for i 2 f1; :::; N g where N is the number of
individuals. The goal of our approach is to produce a new
set of updated and fair ’adjusted’ predictions yadj that
sati
isfy a desired fairness criterion. For each of y^i, yi, and ai,
we define corresponding random variables Y^ , Y , A. Then,
following Hardt, Price, and Srebro (2016) we define the
random variable for the adjusted predictions Y adj to be a
randomized function of Y^ and A. We extend the approach in
Hardt, Price, and Srebro (2016) by allowing multiclass
outcomes, such that the sample spaces of Y^ , Y , and Y adj are
a collection of discrete and mutually exclusive outcomes
C = f1; 2; ::::; jCjg. We in principle allow the sample space
of the protected group A, A , to contain any number of
discrete values as well: A = f1; 2; :::; jA jg.</p>
      <p>1https://github.com/scotthlee/fairness/tree/aaai
Linear Program Our approach involves the
construction of a linear program over the conditional probabilities
of the adjusted predictor P r(Y adj = yadjjY^ = y^; A =
a) such that a desired fairness criterion is satisfied by
those probabilities. In order to construct the linear program,
both the loss and fairness criteria must be linear in terms
of the protected attribute conditional probability matrices
Pa = P r(Y adjjY^ ; A = a) which have dimensions jCj jCj.</p>
      <sec id="sec-2-1">
        <title>Types of Objective Functions We consider objective</title>
        <p>functions which are linear in the group conditional adjusted
probabilities Pa. More specifically we consider minimizing
expected losses of the form:</p>
        <p>E[l(yadj; y)] =</p>
        <p>jCj
X X X P r(Y adj = i; Y = j; A = a)l(i; j; a)
a2A i=1 j6=i</p>
        <p>jCj
= X X X Wiaj P r(A = a; Y = j) l(i; j; a)
a2A i=1 j6=i
where Wiaj = P r(Y adj = ijY = j; A = a) are the
protected attribute conditional confusion matrices. Under the
independence assumption Y adj ? Y jA; Y^ , we can write
Wa = PaZa where Za = P r(Y^ jY; A = a), the class
conditional confusion matrices of the original blackbox
classifier’s predictions. The matrices Za are estimated
empirically from the training data (yi, and ai) and blackbox
predictions of the model (y^i). Therefore, this formulation of the
objective function remains linear in the protected attribute
conditional probability matrices, Pa, as is necessary for the
linear program. This definition is similar to Hardt, Price,
and Srebro (2016) except we let the loss l(i; j; a) also be a
function of protected attributes instead of just the true and
adjusted labels, which allows controlling the strictness of
penalties for errors made for specific protected groups and
classes. The most straightforward version of this loss is
letting l(yadj; y; a) be the zero-one loss (ignoring the protected
attributes) which results in minimizing the sum of the joint
probabilities of mismatch between Y adj and Y . We refer to
this approach as unweighted loss. Another approach is to set
l(yadj; y; a) equal to one over the joint probabilities of the
true label and protected attribute 1=P r(Y = y; A = a)
(estimated empirically), which we refer to as weighted loss.
Intuitively, this option reweights the loss to give rarer protected
groups and label combinations equal importance to the
optimization which could improve fairness when very low
membership minority protected groups exist in the dataset. This
option for the objective function can be equivalently
minimized by maximizing the diagonals (true detection rates) of
the group conditional confusion matrices Wa.</p>
        <p>Types of Fairness We consider several versions of
multiclass fairness criteria, all of which can be written as a
collection of jA j 1 pairwise equalities setting a fairness criterion
of interest equal across all groups. Moreover, each of the
terms in these equalities can be written as some jCj jCj
matrix M a times the adjusted probability matrix Pa, and
therefore are linear in the adjusted probabilities as needed
for the linear program (see appendix A for the exact form
M a takes for the different fairness criteria).</p>
        <p>The first definition involves requiring strictly equal
performance across protected groups.</p>
        <p>Definition 1 (Term-by-Term Multiclass Equality of Odds).
A multiclass predictor satisfies term-by-term equality of
odds if the protected group conditional confusion matrices
Wa are equal across all protected groups:</p>
        <p>W1 = W2 =
= WjA j
(1)</p>
        <p>This is a straightforward extension to the multiclass case
of equality of odds defined in Hardt, Price, and Srebro
(2016). Notice that since this definition requires equality of
each off-diagonal term of Wa across all groups, it enforces
that not only are errors made at the same overall rate across
groups, but also that the rate of specific types of errors are
equal. For some practical applications, term-by-term
equality of odds is important, such as predicting criminal
recidivism times binned into three years, two years, one year, and
”never recommits”. In this case, making the error of
predicting 3 years until recidivism when the actual time is 1 year is
much worse than predicting 3 years when the actual time is
2. Therefore, it is critical for fairness in this application that
the rates of specific types of errors are strictly equal across
groups.</p>
        <p>Instead of requiring strict equality of off-diagonal terms
of Wa we can instead enforce equality across the classwise
overall false detection rates F DR, which leads to the next
fairness definition:
Definition 2 (Classwise Multiclass Equality of Odds). A
multiclass predictor satisfies classwise multiclass equality
of odds if the diagonals of the protected group conditional
confusion matrices and the protected attribute conditional
vector of false detection rates are equal across all protected
groups:
diag(W1) = diag(W2) =
FDR1 = FDR2 =
= FDRjA j
where FDRa = P r(Y adjjY adj 6= Y; A = a).</p>
        <p>This version of fairness can ’trade’ better performance for
a specific protected group on one off diagonal term in Wa
(i.e. lower error probability for that term) for poorer
performance of the same group on a different off diagonal term
(i.e. higher error probability for another term). Individually
each class label has it’s true detection rate, and overall false
detection rate set equal across groups. Thus, this type of
fairness is ’classwise’.</p>
        <p>For some problems it is sufficient to maintain fair true
detection rates across classes and allow false detection rates to
differ across groups. This is even less restrictive than
Definition 2. This may be desirable when, for example, deciding
whether an accepted college application should be accepted
into a honors program, accepted with scholarship, or
regularly accepted. Since all the outcomes are positive,
unfairness across false detection rates may not be critical, as long
as the true detection rates are fair across groups. This
motivates the following fairness criteria:
Definition 3 (Multiclass Equality of Opportunity). A
multiclass predictor satisfies equality of opportunity if the
diagonals of the protected group conditional confusion matrices
Wa are equal across all groups:
diag(W1) = diag(W2) =</p>
        <p>
          A common and even more relaxed version of fairness
called demographic parity only requires the rate of class
predictions across different groups to be equal
          <xref ref-type="bibr" rid="ref2">(Calders,
Kamiran, and Pechenizkiy 2009)</xref>
          .
        </p>
        <p>Definition 4 (Multiclass Demographic Parity). A multiclass
predictor satisfies demographic parity if the protected group
conditional class probabilities are equal across groups:
P r(Y adjjA = 1) =
P r(Y adjjA = 2) =
= P r(Y adjjA = jA j)
(4)</p>
        <p>
          Enforcing this version of fairness for certain datasets may
produce effectively unfair outcomes
          <xref ref-type="bibr" rid="ref5">(Dwork et al. 2012)</xref>
          .
However, in synthetically produced data, this definition has
been shown to reduce the reputation of disadvantaged
protected groups when repeatedly applied over a long period of
time to sensitive decision-making tasks such as hiring
          <xref ref-type="bibr" rid="ref1 ref8">(Hu
and Chen 2018)</xref>
          .
        </p>
        <p>Note that while the learned adjusted probabilities after
running the linear program, Pa are guaranteed to be fair,
taking the max value over the learned probabilities when
predicting on an individual level will not maintain fairness. In
fact, it can occur that taking the max over the adjusted
probabilities will just result in identical predictions as those made
by the original blackbox classifier. Instead, when
predicting the class of an individual, the corresponding learned
adjusted probabilities must be sampled from in order to
maintain the fairness guarantee.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Related Work</title>
      <p>
        Most prior work done on post-processing based fairness
approaches focus on binary task prediction.
        <xref ref-type="bibr" rid="ref13">Wei, Ramamurthy,
and Calmon (2019</xref>
        ) create a post-processing algorithm that
modifies the raw scores of a binary classifier (instead of
thresholded hard predictions) in order to achieve desired
fairness constraints expressed as linear combinations of the
per-group expected raw scores.
        <xref ref-type="bibr" rid="ref17">Ye and Xie (2020)</xref>
        develop
a general in-processing fairness framework which alternates
between a process of selecting a subset of the training data
and fitting a classifier to that data.
      </p>
      <p>
        Several adversarial approaches to multiclass fairness have
been investigated recently; although these are not blackbox
post-processing algorithms.
        <xref ref-type="bibr" rid="ref18">Zhang, Lemoine, and Mitchell
(2018</xref>
        ) first present the idea of adversarial debiasing, while
Romano, Bates, and Cande`s (2020) present a multiclass
approach for in-process training based on adversarial learning,
with the discriminator distinguishing between the
distribution of the model’s current predictions, the true label, and
artificial protected attributes resampled to be fair, and the
true distribution of the predictions, true labels, and true
protected attributes.
      </p>
      <p>
        Multiclass blackbox post-processing techniques are less
studied; although there have been a few new approaches
recently. Notably,
        <xref ref-type="bibr" rid="ref3">Denis et al. (2021)</xref>
        derive an optimally fair
classifier from a pre-trained model and show several nice
theoretical guarantees, including the asymptotic fairness of
their proposed plug-in estimator. We see 3 key differences
between their approach and the extension to Hardt, Price,
and Srebro (2016) that we propose: they only consider
binary protected attributes (jA j = 2), while we allow
categorical protected attributes (jA j &gt; 2) and can take on any
number of unique values, at least theoretically; their method
requires fitting a new estimator to the test data, whereas ours
only requires computing probabilities and solving a linear
program, which is relatively efficient; and, perhaps most
importantly, their approach is limited to the demographic
parity fairness constraint, whereas our approach applies to any
constraint that is linear in Pa.
      </p>
      <p>In broader terms, Hossain, Mladenovic, and Shah (2020)
unify many of the published methods for learning fair
classifiers by showing that equalized odds, equal opportunity,
and other common measures of fairness in the binary
setting are subsumed by their proposed generalizations of the
economic notions of envy-freeness and equitability. They
show that these generalizations of fairness apply to the
multiclass setting, but post-processing techniques are incapable
of achieving them. We show here that this notion is not
entirely correct, at least in a narrow sense, and that fairness
can be achieved with post-processing techniques in the
multiclass setting, so long as the joint distribution P (Y; Y^ ; A) is
either fully known or can be reasonably approximated by a
large-enough sample of training data.</p>
    </sec>
    <sec id="sec-4">
      <title>Synthetic Data Experiments</title>
      <p>Synthetic Data To explore the effect of different data
regimes and optimization goals on post-adjustment
discrimination, we conducted thorough (though by no means
exhaustive) synthetic experiments for a 3-class outcome. We
constructed synthetic datasets with N = 1; 000 observations for
each unique combination of the following data-generating
hyperparameters:
• The number of unique values for the protected attribute,
jA j. We explored setting jA j = 2 or jA j = 3 (see
results with jA j = 2 in our github repository)
• The amount of class imbalance for the labels Y . For
simplicity, we did not allow this to vary across protected
groups.
• Group balance, or the number and relative size of
minority groups compared to majority groups. This varied
according to the number of groups but was generally either
none, weak, or strong.
• Predictive bias as the difference in mean true detection
rate, T DR, between the groups. We vary this from mild
predictive bias (10 percent difference) to severe bias with
the minority group T DR being near chance. The
predictive bias is set to always favor the majority group.</p>
      <p>This process yielded 117 datasets. For each one, we ran
the linear program to adjust the (synthetic) biased blackbox
predictions 8 times, once for each unique combination of
the objective function and type of fairness, yielding a total
of 936 adjustments. After each adjustment, we recorded two
broad measures of the fair predictor’s performance:
• Triviality, or whether any of the columns in Wa =
P r(Y adjjY; A = a) contained all zeroes (i.e., whether
any levels of the outcome were no longer predicted).
• Discrimination, or the percent change in loss for the
adjusted predictor relative to that of the original
predictor. For this measure, we examined two specific metrics:
global accuracy and the mean of the group-wise T DRs.
These are equivalent to 1 minus the post-adjustment loss
under the two versions of the objective functions we
present above.</p>
      <p>To quantify the average effect of each hyperparameter
on discrimination, we fit two multivariable linear regression
models to the resulting dataset, one for each discrimination
metric. Before fitting the models, we converted the
categorical hyperparameters (so all but loss) to one-hot variables,
and then we set a reference level for each, removing the
corresponding column from the design matrix. We then fit the
models separately using ordinary least squares (OLS) and
calculated confidence intervals (CIs) for the resulting
coefficients.</p>
      <p>Results Table 1 shows coefficients and 95% confidence
intervals for the regression models with jA j = 3. The results
highlight several important points:
• Predictive bias and class imbalance are the two main
drivers of decreases in post-adjustment discrimination,
for both accuracy, and T DR.
• High group imbalance for the protected attributes lowers
post-adjustment discrimination, but only from the
perspective of global accuracy–even with 2 strong
minorities (3-group scenario), mean T DR only drops by 1.1%.
• Relative to the weighted objective, the unweighted
objective leads to higher scores for global accuracy but lower
scores for mean T DR. This is perhaps unsurprising, but
it is worth noting nonetheless.
• Despite finding better accuracy solutions, we also found
that the unweighted objective leads to trivial solutions
far more frequently (30% of the time it was used) than
the weighted version of the loss (0.2% of the time it was
used). This trend will likely worsen with increasing
dimension of either the number of classes or the number of
protected groups.
• Fairness is generally harder to achieve with 3 protected
groups than with 2, since the intercepts are lower for both
accuracy and mean T DR. We believe this to be a general
consequence of forcing fairness across more groups and
expect this trend to continue as the number of groups
increases.</p>
    </sec>
    <sec id="sec-5">
      <title>Experiments with Real-World Data</title>
      <p>
        Dataset Descriptions To further examine the performance
characteristics of our algorithm, we ran it on several
realworld datasets described below.
1. Drug Usage
        <xref ref-type="bibr" rid="ref6">(Fehrman et al. 2017)</xref>
        . This dataset has
inherently multiclass outcomes, with the target being a
7level categorical variable indicating recentness of use for
a variety of drugs. We focus on predicting cannabis
usage, where we collapsed the 7-level usage indicator into
3 broader categories: never used, used but not in the past
year, and used in the past year. Predictors included
demographic variables like age, gender, and level of education,
as well as a variety of measures of personality traits
hypothesized to affect usage habits.
2. Obesity
        <xref ref-type="bibr" rid="ref9">(Palechor and de la Hoz Manotas 2019)</xref>
        . This
dataset has inherently multiclass outcomes, with the
target being a 7-level categorical variable indicating weight
category; the protected attribute is gender
(Male/Female). Because some of the observations are synthetic
in order to protect privacy, not all of the gender/weight
categories had sufficient numbers for modeling, and so
we omitted observations from the 2 most extreme weight
categories, Obesity Type-II and Obesity Type-III, leaving
a 5-level target for prediction. Predictors included age,
gender, family medical history, and several measures of
physical activity and behavioral health.
3. LSAC Bar Passage
        <xref ref-type="bibr" rid="ref15">(Wightman 1998)</xref>
        . This dataset has
inherently multiclass outcomes, with the target being a
3level variable indicating bar exam passage status (passed
first time, passed second time, or did not pass). The
protected attribute is race, which we collapsed from its
original 8 levels to 2 (white and non-white). Predictors
included mostly measures of educational achievement, like
undergraduate GPA, law school GPA, and LSAT score.
4. Parkinson’s Telemonitoring
        <xref ref-type="bibr" rid="ref11">(Tsanas et al. 2009)</xref>
        . This
dataset does not have inherently multiclass outcomes,
with the target for prediction being the continuous
Unified Parkinson’s Disease Rating Scale (UPDRS), a
continuous score that increases with the severity of
impairment. We again used Otsu’s method to bin the
continuous score into 3 categories–low impairment,
moderate impairment, and high impairment–which we took as
the new class labels. The protected attribute is a 2-level
variable for gender (Male/Female). Predictors included
mostly biomedical measurements from the voice
recordings of patients with Parkinson’s Disease.
      </p>
      <p>For each of these datasets, we obtained a
potentiallybiased predictor Y^ by training a random forest on all
available informative features (including the protected attribute)
to predict the multiclass outcome, and then taking the
categories corresponding to the row-wise maxima of the
outof-bag decision scores as the set of predicted labels. We
then adjusted the predictions with the weighted objective
and term-by-term equality of odds fairness constraint and
recorded the relative changes in global accuracy and mean
T DR as the outcome measures of interest, as with our
synthetic experiments.</p>
      <p>Exploring the Effect of Finite Sampling Hardt, Price,
and Srebro (2016) note that their method will not be
effected by finite sample variability as long as the joint
distribution P r(Y; Y^ ; A) is known, or at least well-approximated
by a large sample. In practical applications, however, the
sample at hand may not be large enough to approximate
the joint distribution with precision. This problem is
exacDataset (N)
erbated when the number of observations N is small
relative to the number of probabilities learned by the algorithm
of which there are jCj jCj jA j total. This difficulty is
therefore more severe for our extension in this work where
jCj &gt; 2.</p>
      <p>In these cases, the adjusted predictor Y adj may have worse
classification performance and higher disparity when
applied to unseen, out-of-sample data. As a preliminary
exploration of this effect, we used 5-fold cross-validation to
generate out-of-sample predictions for each of the
observations in our real-world datasets. Keeping Y , Y^ , and A fixed,
we solved the linear program on 80% of the data and then
used the adjusted probabilities Pa to obtain class
predictions for the observations in the remaining 20%. As with the
predictions obtained from solving the linear program on the
full dataset, we measured the changes in accuracy and mean
T DR for the cross-validated predictions. Because fairness
is not guaranteed when the joint distribution assumption is
violated, we also measured post-adjustment fairness.
Exploring the Fairness-Discrimination Tradeoff When
there are large gaps in a predictor’s performance across
groups, i.e., when predictive bias is high, strict fairness may
not always be possible or desirable to achieve because of
the large amount of randomization required to balance the
blackbox classifier’s predictions. To explore the tradeoff
between fairness and discrimination, we ran the linear
program on each of the real-world datasets once for each of the
four kinds of fairness. For each combination of dataset and
fairness type, we varied the equality constraints of the
linear program–the maximum percent difference allowed
between any pairwise comparison of fairness measures
between groups–from 0.0 to 1.0 in increments of 0.01, and then
plotted the value of the weighted objective at each point as a
function of the global measure of fairness corresponding to
the fairness type under consideration. To obtain these global
measures, we took the maximum of the mean differences
across pairs of groups of the following metrics:
• W, or the matrix of probabilities P (Y adjjY ), for
termby-term equality of odds
• Youden’s J index, or T DR+(1 F DR) 1, for classwise
equality of odds
• T DR for equal opportunity
• P (Y adj) for demographic parity</p>
      <p>We note here that taking the maximum of the maxima of
the pairwise differences would also be a valid and sensible
global measure. So that the plots show performance under
optimal conditions, we do not use cross-validation to obtain
Y adj, i.e., we obtain it by solving the linear program on the
entire dataset.</p>
      <p>Results Table 2 shows changes in global accuracy and
mean T DR after adjustment with the weighted objective
and term-by-term conditional fairness constraint for our four
datasets, using cross-validation as described above to
capture some of the variability that comes with finite sampling.
Overall, adjustment lowered both accuracy and mean T DR.
Although, for the bar passage, drug usage, and Parkinson’s
datasets, the drops were moderate, with average relative
changes in both metrics coming in at around 12% and 15%,
respectively (without cross-validation, the drops were much
smaller at 3% and 4%). For the obesity dataset, the drops
are much larger at 47% and 46%, respectively, which are
indeed substantial and would likely make the predictor
unusable in practical settings. On in-sample data, these drops
were both only around 7%, and so we suspect that
characteristics of the data, like large class imbalance or small
overall sample size, are responsible for the poor performance.
Perhaps most importantly, the post-adjustment disparity for
all datasets is non-zero, and for three of the datasets
actually increases. The bar passage dataset was the only
example where the out-of-sample post-adjustment disparity
decreased to near zero likely due to it being the largest dataset.
This starkly points out the sensitivity of the method to
estimating the joint probabilities P r(Y; Y^ ; A), and shows that
the approach is unlikely to work in smaller dataset regimes
which have a larger combination of classes and protected
attributes. Note that for in-sample results, post-adjustment
disparity drops completely to 0.0 for all datasets since it is
strictly enforced by the linear program in Table 2.</p>
      <p>Figure 1 shows fairness-discrimination plots for our 4
datasets with the weighted objective and each of the 4
fairness constraints. Under strict fairness, with inequality set
to 0, equalized odds is the hardest to satisfy, showing the
largest increase in Brier score. For the drug usage, obesity,
and Parkinson’s datasets, discrimination improves
approximately linearly as fairness worsens; for the bar passage
dataset, discrimination improves to a point, but then worsens
as fairness approaches the value for the original, unadjusted
predictor Y^ . For all datasets, the total loss of discrimination
under strict fairness is relatively small (the biggest drop is
around 7.5 percentage points on Brier score), but the random
forests’ predictions were only mildly biased to begin with,
so we expect this gap to increase for less-fair predictors.</p>
    </sec>
    <sec id="sec-6">
      <title>Discussion</title>
      <p>Generally, our post-processing approach to achieving
fairness in multiclass settings seems both feasible and efficient
given a large enough dataset size. We have shown above that
the linear programming technique proposed by Hardt, Price,
and Srebro (2016) can be extended to accommodate a
theoretically arbitrarily large number of discrete outcomes and
levels of a protected attribute. Nonetheless, our synthetic
experiments and analyses of real-world datasets show that are a
few important considerations for using the approach in
practice.</p>
      <p>In many cases, the effect of finite sampling may be
nonnegligible, especially when the number of observations N is
small relative to number of outcomes jCj or the number of
protected groups jA j. For example, the obesity dataset with
jCj = 5 and N = 1; 490 saw a large relative drop of 46% in
mean T DR after adjustment under cross-validation. We also
saw this effect extend to fairness, which was not reduced
completely to zero on out-of-sample data for any of the
realworld datasets. In fact, for the drug usage dataset we found
post-adjustment disparity doubled on out-of-sample data.</p>
      <p>This last observation raises a concerning point: for some
classification problems, the post-adjustment predictions on
out-of-sample data may increase disparity rather than
lowering it. For the largest of the datasets, the bar passage
dataset with N = 22; 406, neither of these issues was a
concern. Even under cross-validation, the relative change
in T DR was only -8%, and the disparity dropped to near
0 (-95% decrease). Given this, we expect that with a large
enough dataset size, our approach will be far more reliable
on out-of-sample data. Future work more precisely
quantifying the number of training examples needed for reliable
out-of-sample fair performance with our approach is needed.</p>
      <p>
        More generally, even when finite sampling variability is
not an issue, not all datasets will lend themselves well to
this kind of post-processing approach. In our synthetic
experiments, we showed that severe class imbalance and
severe predictive bias (predicting at nearly the level of chance
for minority protected groups) lead to large drops in
postadjustment performance on average. In many of the
single experimental runs for synthetic datasets with these
settings, the resulting derived predictor was effectively
useless, either producing trivial results or lowering predictive
performance to near chance (for all groups) for one or
more class outcomes. In these circumstances, it may be
more sensible to enforce fairness through a combination of
pre-processing, in-processing, and post-processing methods,
rather than through a post-processing method alone. Indeed,
        <xref ref-type="bibr" rid="ref16">Woodworth et al. (2017)</xref>
        make this point generally, albeit
for the binary setting, by showing that unless the biased
predictor Y^ is very close to being Bayes optimal, the derived
predictor Y adj proposed by Hardt, Price, and Srebro (2016)
can underperform relative to other methods, sometimes
substantially. Under less extreme circumstances, however, we
found our approach produces good results, especially given
the time-efficiency of solving the linear program relative to
other methods.
      </p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>This work was supported in part by the HPI Research
Center in Machine Learning and Data Science at UC Irvine (P.
Putzel), as well as in part by an appointment to the Research
Participation Program at the Centers for Disease Control and
Prevention, administered by the Oak Ridge Institute for
Science and Education (P. Putzel). We would also like to thank
Chad Heilig, and Padhraic Smyth for their helpful comments
on the approach and paper.</p>
      <p>Hardt, M.; Price, E.; and Srebro, N. 2016. Equality of
opportunity in supervised learning. Advances in neural
information processing systems, 29: 3315–3323.</p>
    </sec>
    <sec id="sec-8">
      <title>Appendix A</title>
      <sec id="sec-8-1">
        <title>Derivation of Linearity of Fairness Constraints: In or</title>
        <p>der to obtain linearity in the protected attribute conditional
probability matrices Pa we must find an expression of the
form Wa = PaMa:</p>
        <p>Wiaj =P r(Y adj = ijY = j; A = a)
= X P r(Y adj = j; Y^ = kjY = j; A = a)
= X P r(Y adj = ijY = j; A = a; Y^ = k)
= X P r(Y adj = ijY^ = k; A = a)</p>
        <p>P r(Y^ = kjY = j; A = a)</p>
        <p>P r(Y^ = kjY = j; A = a)
where Zkaj = P r(Y^ = kjY = j; A = a), and can be
estimated empirically using the original predictions of the
blackbox classifier. Thus we have Wa = PaZa. Moving
from the third to fourth line requires the conditional
independence assumption Y adj ? Y jA; Y^ . This assumption is
violated in cases where the blackbox predictions are weak, for
example completely random, and can intuitively be thought
of as requiring that the initial blackbox classifier has
reasonable discriminative performance. In other words, relevant
information for predicting Y is contained in Y^ .</p>
        <p>Multiclass equality of opportunity only requires enforcing
equality on the diagonals of Wa, and therefore is linear in
Pa as well.</p>
        <p>Enforcing the classwise version of multiclass equality of
odds requires enforcing equality of opportunity, which is
already shown to be linear above, and also enforcing the
overall false detection rates to be equal across protected groups.
So in order for classwise multiclass equality of odds to be
linear, the false detection rates must be linear in Pa, shown
below:</p>
        <p>F DRca =P r(Y adj = cjY 6= c; A = a)
=</p>
        <p>P r(Y adj = c; Y 6= c; A = a)</p>
        <p>P r(Y 6= c; A = a)
= X X P r(Y adj = c; Y = c0; Y^ = j; A = a)</p>
        <p>P r(Y 6= c; A = a)
= X X Pcaj Zjac0 P r(Y = c0; A = a)</p>
        <p>P r(Y 6= c; A = a)
Zjac0 P r(Y = c0; A = a)</p>
        <p>P r(Y 6= c; A = a)
j c06=c
j c06=c
= X Pcaj X
= X Pcaj Vjac</p>
        <p>c06=c
j
j
where Vjac = Pc06=c ZjacP0 rP(rY(Y6=c=;Ac0=;Aa=) a) . This allows us to
write the protected attribute conditional false detection rates
as FDRa = diag(PaVa). As before, Va can be computed
from the empirical estimates of Za, and P r(Y = i; A = j).</p>
        <p>For multiclass demographic parity we can write:
Da =P r(Y adjjA = a)
=</p>
        <p>1
P r(A = a)
k</p>
        <p>X P r(Y adj; A = a; Y^ = k)
k
k
=PaP r(Y^ jA = a)
= X P r(Y adjjY^ = k; A = a)
= X P r(Y adjjY^ = k; A = a)P r(Y^ = kjA = a)
P r(Y^ = k; A = a)</p>
        <p>P r(A = a)
which is again linear in Pa, and the conditional probability
vector P r(Y^ jA = a) can be computed emprically.
Synthetic Experiment Results with jA j = 2
Hyperparameter
Class Balance
Predictive Bias</p>
        <p>Level</p>
        <p>–</p>
        <p>Low
Medium
High</p>
        <p>Change in Acc (CI)</p>
        <p>Change in TDR (CI)</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Buolamwini</surname>
            , J.; and Gebru,
            <given-names>T.</given-names>
          </string-name>
          <year>2018</year>
          .
          <article-title>Gender shades: Intersectional accuracy disparities in commercial gender classification</article-title>
          . In Conference on fairness,
          <source>accountability and transparency</source>
          ,
          <volume>77</volume>
          -
          <fpage>91</fpage>
          . PMLR.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>Calders</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Kamiran</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ; and Pechenizkiy,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <year>2009</year>
          .
          <article-title>Building classifiers with independency constraints</article-title>
          .
          <source>In 2009 IEEE International Conference on Data Mining Workshops</source>
          ,
          <fpage>13</fpage>
          -
          <lpage>18</lpage>
          . IEEE.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Denis</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Elie</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ; Hebiri,
          <string-name>
            <given-names>M.</given-names>
            ; and
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          <year>2021</year>
          .
          <article-title>Fairness guarantee in multi-class classification</article-title>
          .
          <source>arXiv preprint arXiv:2109</source>
          .
          <fpage>13642</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Dieterich</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ; Mendoza,
          <string-name>
            <surname>C.</surname>
          </string-name>
          ; and Brennan,
          <string-name>
            <surname>T.</surname>
          </string-name>
          <year>2016</year>
          .
          <article-title>COMPAS risk scales: Demonstrating accuracy equity and predictive parity</article-title>
          .
          <source>Northpointe Inc.</source>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Dwork</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Hardt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Pitassi</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Reingold</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ; and Zemel,
          <string-name>
            <surname>R.</surname>
          </string-name>
          <year>2012</year>
          .
          <article-title>Fairness through awareness</article-title>
          .
          <source>In Proceedings of the 3rd innovations in theoretical computer science conference</source>
          ,
          <volume>214</volume>
          -
          <fpage>226</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Fehrman</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Muhammad</surname>
            ,
            <given-names>A. K.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mirkes</surname>
            ,
            <given-names>E. M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Egan</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Gorban</surname>
            ,
            <given-names>A. N.</given-names>
          </string-name>
          <year>2017</year>
          .
          <article-title>The five factor model of personality and evaluation of drug consumption risk</article-title>
          .
          <source>In Data science</source>
          ,
          <fpage>231</fpage>
          -
          <lpage>242</lpage>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <string-name>
            <surname>Hossain</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Mladenovic</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Shah</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <year>2020</year>
          .
          <article-title>Designing fairly fair classifiers via economic fairness notions</article-title>
          .
          <source>In Proceedings of The Web Conference</source>
          <year>2020</year>
          ,
          <fpage>1559</fpage>
          -
          <lpage>1569</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Hu</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ; and Chen,
          <string-name>
            <surname>Y.</surname>
          </string-name>
          <year>2018</year>
          .
          <article-title>A short-term intervention for long-term fairness in the labor market</article-title>
          .
          <source>In Proceedings of the 2018 World Wide Web Conference</source>
          ,
          <volume>1389</volume>
          -
          <fpage>1398</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Palechor</surname>
            ,
            <given-names>F. M.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>de la Hoz Manotas</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2019</year>
          .
          <article-title>Dataset for estimation of obesity levels based on eating habits and physical condition in individuals from Colombia, Peru and Mexico</article-title>
          . Data in brief,
          <volume>25</volume>
          :
          <fpage>104344</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          <string-name>
            <surname>Romano</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Bates</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; and Cande`s,
          <string-name>
            <surname>E. J.</surname>
          </string-name>
          <year>2020</year>
          .
          <article-title>Achieving Equalized Odds by Resampling Sensitive Attributes</article-title>
          . arXiv preprint arXiv:
          <year>2006</year>
          .04292.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Tsanas</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Little</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>McSharry</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Ramig</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <article-title>Accurate telemonitoring of Parkinson's disease progression by non-invasive speech tests</article-title>
          .
          <source>Nature Precedings</source>
          ,
          <fpage>1</fpage>
          -
          <lpage>1</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>Wei</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Ramamurthy</surname>
            ,
            <given-names>K. N.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Calmon</surname>
            ,
            <given-names>F. d. P.</given-names>
          </string-name>
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <article-title>Optimized score transformation for fair classification</article-title>
          . arXiv preprint arXiv:
          <year>1906</year>
          .00066.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Wightman</surname>
            ,
            <given-names>L. F.</given-names>
          </string-name>
          <year>1998</year>
          .
          <article-title>LSAC National Longitudinal Bar Passage Study</article-title>
          .
          <source>LSAC Research Report Series.</source>
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Woodworth</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Gunasekar</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ; Ohannessian,
          <string-name>
            <given-names>M. I.;</given-names>
            and
            <surname>Srebro</surname>
          </string-name>
          ,
          <string-name>
            <surname>N.</surname>
          </string-name>
          <year>2017</year>
          .
          <article-title>Learning non-discriminatory predictors</article-title>
          .
          <source>In Conference on Learning Theory</source>
          ,
          <fpage>1920</fpage>
          -
          <lpage>1953</lpage>
          . PMLR.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Ye</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ; and
          <string-name>
            <surname>Xie</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <year>2020</year>
          .
          <article-title>Unbiased Subdata Selection for Fair Classification: A Unified Framework and Scalable Algorithms</article-title>
          . arXiv preprint arXiv:
          <year>2012</year>
          .12356.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>B. H.</given-names>
          </string-name>
          ;
          <string-name>
            <surname>Lemoine</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ; and Mitchell,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <year>2018</year>
          .
          <article-title>Mitigating unwanted biases with adversarial learning</article-title>
          .
          <source>In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society</source>
          ,
          <volume>335</volume>
          -
          <fpage>340</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>