Skip to contents

Fairness Measures in mlr3

Usage

mlr_measures_fairness

Format

An object of class data.table (inherits from data.frame) with 18 rows and 2 columns.

Value

A data.table containing an overview of available fairness metrics.

Predefined measures

mlr3fairness comes with a set of predefined fairness measures as listed below. For full flexibility, MeasureFairness can be used to construct classical group fairness measures based on a difference between a performance metrics across groups by combining a performance measure with an operation for measuring differences. Furthermore MeasureSubgroup can be used to measure performance in a given subgroup, or alternatively groupwise_metrics(measure, task) to instantiate a measure for each subgroup in a Task.

keydescription
fairness.accAbsolute differences in accuracy across groups
fairness.mseAbsolute differences in mean squared error across groups
fairness.fnrAbsolute differences in false negative rates across groups
fairness.fprAbsolute differences in false positive rates across groups
fairness.tnrAbsolute differences in true negative rates across groups
fairness.tprAbsolute differences in true positive rates across groups
fairness.npvAbsolute differences in negative predictive values across groups
fairness.ppvAbsolute differences in positive predictive values across groups
fairness.fomrAbsolute differences in false omission rates across groups
fairness.fpAbsolute differences in false positives across groups
fairness.tpAbsolute differences in true positives across groups
fairness.tnAbsolute differences in true negatives across groups
fairness.fnAbsolute differences in false negatives across groups
fairness.cvDifference in positive class prediction, also known as Calders-Wevers gap or demographic parity
fairness.eodEqualized Odds: Mean of absolute differences between true positive and false positive rates across groups
fairness.ppPredictive Parity: Mean of absolute differences between ppv and npv across groups
fairness.acc_eod=.05Accuracy under equalized odds < 0.05 constraint
fairness.acc_ppv=.05Accuracy under ppv difference < 0.05 constraint

Examples

library("mlr3")
# Predefined measures:
mlr_measures_fairness$key
#>  [1] "fairness.acc"         "fairness.mse"         "fairness.fnr"        
#>  [4] "fairness.fpr"         "fairness.tnr"         "fairness.tpr"        
#>  [7] "fairness.npv"         "fairness.ppv"         "fairness.fomr"       
#> [10] "fairness.fp"          "fairness.tp"          "fairness.tn"         
#> [13] "fairness.fn"          "fairness.cv"          "fairness.eod"        
#> [16] "fairness.pp"          "fairness.acc_eod=.05" "fairness.acc_ppv=.05"