View source: R/dsldFairUtils.R
dsldFairUtils | R Documentation |
Exploration of the Fairness-Utility Tradeoff. Finds predictive accuracy and correlation between S and predicted Y.
dsldFairUtils(data, yName, sName, dsldFTNName, unfairness = NULL,
deweightPars = NULL, yesYVal = NULL, k_folds = 5,model_args = NULL)
data |
Data frame. |
yName |
Name of the response variable Y column. Y must be numeric or binary (two-level R factor). |
sName |
Name of the sensitive attribute S column. |
dsldFTNName |
Quoted name of one of the fairML or EDF functions. |
unfairness |
Vector of unfairness values. Nonnull for the fairML functions. |
deweightPars |
List of deweightPars grid. Nonnull for the EDF functions. |
yesYVal |
Y value to be treated as Y = 1 for binary Y. |
k_folds |
Number of folds to use in $k$-fold cross-validation. The final result is reported as the average across all folds. |
model_args |
A named list of additional arguments passed directly to |
Tool for exploring tradeoff between utility (predictive accuracy, Mean Absolute Prediction Error or overall probability of misclassification) and fairness. Roughly speaking, the latter is defined as the strength of relation between S and predicted Y (the smaller, the better).
A data-frame showing accuracy and correlation between predicted Y and S.
A.Mittal, N. Matloff
data(svcensus)
## regression examples shown --- also works for classification
dsldFairUtils(svcensus,
'wageinc',
'gender',
'dsldQeFairKNN',
k_folds = 5,
model_args = list(k = 25),
deweightPars = list('occ' = c(0.9,0.2), 'educ' = c(0.3, 0.9)))
dsldFairUtils(svcensus,
'wageinc',
'gender',
'dsldFrrm',
k_folds = 5,
unfairness = c(0.9, 0.6, 0.1,0.05, 0.005))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.