* using log directory ‘/Volumes/Builds/packages/big-sur-x86_64/results/4.3/mlr3fairness.Rcheck’ * using R version 4.3.0 (2023-04-21) * using platform: x86_64-apple-darwin20 (64-bit) * R was compiled by Apple clang version 14.0.3 (clang-1403.0.22.14.1) GNU Fortran (GCC) 12.2.0 * running under: macOS Ventura 13.3.1 * using session charset: UTF-8 * checking for file ‘mlr3fairness/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘mlr3fairness’ version ‘0.3.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘mlr3fairness’ can be installed ... [8s/14s] OK See 'https://www.r-project.org/nosvn/R.check/r-oldrel-macos-x86_64/mlr3fairness-00install.html' for details. * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [1s/3s] OK * checking whether the package can be loaded with stated dependencies ... [1s/2s] OK * checking whether the package can be unloaded cleanly ... [1s/2s] OK * checking whether the namespace can be loaded with stated dependencies ... [1s/2s] OK * checking whether the namespace can be unloaded cleanly ... [1s/2s] OK * checking loading without being on the library search path ... [1s/2s] OK * checking startup messages can be suppressed ... [1s/3s] OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [9s/16s] OK * checking Rd files ... [1s/1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... [0s/1s] OK * checking LazyData ... OK * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... [10s/19s] OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... [11s/20s] OK Running ‘testthat.R’ [10s/20s] * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... [1s/2s] NONE ‘debiasing-vignette.Rmd’ using ‘UTF-8’... [0s/0s] OK ‘measures-vignette.Rmd’ using ‘UTF-8’... [0s/1s] OK ‘reports-vignette.Rmd’ using ‘UTF-8’... [0s/0s] OK ‘visualization-vignette.Rmd’ using ‘UTF-8’... [0s/0s] OK * checking re-building of vignette outputs ... [91s/181s] ERROR Error(s) in re-building vignettes: --- re-building ‘debiasing-vignette.Rmd’ using rmarkdown Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed. 2023-07-10 23:46:26.428 R[80044:2290430804] XType: Using static font registry. Warning in file.info(x, extra_cols = FALSE) : expanded path length 4561 would be too long for

Introduction: Fairness Pipeline Operators

Given we detected some form of bias during bias auditing, we are often interested in obtaining fair(er) models. There are several ways to achieve this, such as collecting additional data or finding and fixing errors in the data. Assuming there are no biases in the data and labels, one other option is to debias models using either preprocessing, postprocessing and inprocessing methods. mlr3fairness provides some operators as PipeOps for mlr3pipelines. If you are not familiar with mlr3pipelines, the mlr3 book contains an introduction.

We again showcase debiasing using the adult_train task:

library(mlr3)
library(mlr3fairness)
librar [... truncated]
--- finished re-building ‘debiasing-vignette.Rmd’

--- re-building ‘measures-vignette.Rmd’ using rmarkdown
Pandoc is required to build R Markdown vignettes but not available. Please make sure it is installed.
Warning in file.info(x, extra_cols = FALSE) :
  expanded path length 17990 would be too long for

Fairness Measures

Fairness measures (or metrics) allow us to assess and audit for possible biases in a trained model. There are several types of metrics that are widely used in order to assess a model’s fairness. They can be coarsely classified into three groups: