frrm | R Documentation |
A regression model enforcing fairness with a ridge penalty.
# a fair ridge regression model.
frrm(response, predictors, sensitive, unfairness,
definition = "sp-komiyama", lambda = 0, save.auxiliary = FALSE)
# a fair generalized ridge regression model.
fgrrm(response, predictors, sensitive, unfairness,
definition = "sp-komiyama", family = "binomial", lambda = 0,
save.auxiliary = FALSE)
response |
a numeric vector, the response variable. |
predictors |
a numeric matrix or a data frame containing numeric and factor columns; the predictors. |
sensitive |
a numeric matrix or a data frame containing numeric and factor columns; the sensitive attributes. |
unfairness |
a positive number in [0, 1], how unfair is the model allowed
to be. A value of |
definition |
a character string, the label of the definition of fairness
used in fitting the model. Currently either |
family |
a character string, either |
lambda |
a non-negative number, a ridge-regression penalty coefficient. It defaults to zero. |
save.auxiliary |
a logical value, whether to save the fitted values and
the residuals of the auxiliary model that constructs the decorrelated
predictors. The default value is |
frrm()
and fgrrm()
can accommodate different definitions of
fairness, which can be selected via the definition
argument. The labels
for the built-in definitions are:
"sp-komiyama"
for the same definition of fairness as
nclm()
: the model bounds the proportion of the variance that is
explained by the sensitive attributes over the total explained variance.
This falls within the definition of statistical parity.
"eo-komiyama"
enforces equality of opportunity in a similar
way: it regresses the fitted values against the sensitive attributes and
the response, and it bounds the proportion of the variance explained by
the sensitive attributes over the total explained variance in that model.
"if-berk"
enforces individual fairness by penalizing the model
for each pair of observations with different values of the sensitive
attributes and different responses.
Users may also pass a function via the definition
argument to plug
custom fairness definitions. This function should have signature
function(model, y, S, U, family)
and return an array with an element
called "value"
(optionally along with others). The arguments will
contain the model fitted for the current level of fairness (model
),
the sanitized response variable (y
), the design matrix for the
sanitized sensitive attributes (S
), the design matrix for the
sanitized decorrelated predictors (U
) and the character string
identifying the family the model belongs to (family
).
The algorithm works like this:
regresses the predictors against the sensitive attributes;
constructs a new set of predictors that are decorrelated from the sensitive attributes using the residuals of this regression;
regresses the response against the decorrelated predictors and the sensitive attributes; while
using a ridge penalty to control the proportion of variance the sensitive attributes can explain with respect to the overall explained variance of the model.
Both sensitive
and predictors
are standardized internally before
estimating the regression coefficients, which are then rescaled back to match
the original scales of the variables.
fgrrm()
is the extension of frrm()
to generalized linear models,
currently implementing linear (family = "gaussian"
) and logistic
(family = "binomial"
) regressions. fgrrm()
is equivalent to
frrm()
with family = "gaussian"
. The definition of fairness are
identical between frrm()
and fgrrm()
.
frrm()
returns an object of class c("frrm", "fair.model")
.
fgrrm()
returns an object of class c("fgrrm", "fair.model")
.
Marco Scutari
Scutari M, Panero F, Proissl M (2022). "Achieving Fairness with a Simple Ridge
Penalty". Statistics and Computing, 32, 77.
https://link.springer.com/content/pdf/10.1007/s11222-022-10143-w.pdf
nclm, zlm, zlrm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.