dsldFairUtils: dsldFairUtils

View source: R/dsldFairUtils.R

dsldFairUtilsR Documentation

dsldFairUtils

Description

Exploration of the Fairness-Utility Tradeoff. Finds predictive accuracy and correlation between S and predicted Y.

Usage

dsldFairUtils(data, yName, sName, dsldFTNName, unfairness = NULL,
  deweightPars = NULL, yesYVal = NULL, k_folds = 5,model_args = NULL)

Arguments

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 dsldFtnName. For example, model_args = list(k = 25).

Details

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).

Value

A data-frame showing accuracy and correlation between predicted Y and S.

Author(s)

A.Mittal, N. Matloff

Examples

  


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))


dsld documentation built on Sept. 14, 2025, 1:07 a.m.