mlr_pipeops_equalized_odds {mlr3fairness}R Documentation

Equalized Odds Debiasing

Description

Fairness post-processing method to achieve equalized odds fairness. Works by randomly flipping a subset of predictions with pre-computed probabilities in order to satisfy equalized odds constraints.
NOTE: Carefully assess the correct privileged group.

Format

R6Class object inheriting from PipeOpTaskPreproc/PipeOp.

Construction

PipeOpEOd*$new(id = "eod", param_vals = list())

Input and Output Channels

Input and output channels are inherited from PipeOpTaskPreproc. Instead of a Task, a TaskClassif is used as input and output during training and prediction.

The output during training is the input Task. The output during prediction is a PredictionClassif with partially flipped predictions.

State

The ⁠$state⁠ is a named list with the ⁠$state⁠ elements inherited from PipeOpTaskPreproc.

Parameters

Fields

Only fields inherited from PipeOpTaskPreproc/PipeOp.

Methods

Methods inherited from PipeOpTaskPreproc/PipeOp.

Super class

mlr3pipelines::PipeOp -> PipeOpEOd

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this [R6][R6::R6Class][PipeOp] R6 class.

Usage
PipeOpEOd$new(id = "EOd", param_vals = list())
Arguments
id

character
The PipeOps identifier in the PipeOps library.

param_vals

list
The parameter values to be set. See Parameters.


Method clone()

The objects of this class are cloneable with this method.

Usage
PipeOpEOd$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

Hardt M, Price E, Srebro N (2016). “Equality of Opportunity in Supervised Learning.” In Advances in Neural Information Processing Systems, volume 29, 3315–3323. https://papers.nips.cc/paper/2016/file/9d2682367c3935defcb1f9e247a97c0d-Paper.pdf.

Pleiss, Geoff, Raghavan, Manish, Wu, Felix, Kleinberg, Jon, Weinberger, Q K (2017). “On Fairness and Calibration.” In Guyon I, Luxburg UV, Bengio S, Wallach H, Fergus R, Vishwanathan S, Garnett R (eds.), Advances in Neural Information Processing Systems, volume 30. https://proceedings.neurips.cc/paper/2017/file/b8b9c74ac526fffbeb2d39ab038d1cd7-Paper.pdf.

See Also

https://mlr3book.mlr-org.com/list-pipeops.html

Other PipeOps: mlr_pipeops_explicit_pta, mlr_pipeops_reweighing

Examples

library("mlr3")
library("mlr3pipelines")

eod = po("EOd")
learner_po = po("learner_cv",
  learner = lrn("classif.rpart"),
  resampling.method = "insample"
)

task = tsk("compas")
graph = learner_po %>>% eod
glrn = GraphLearner$new(graph)
glrn$train(task)

# On a Task
glrn$predict(task)

# On newdata
glrn$predict_newdata(task$data(cols = task$feature_names))

[Package mlr3fairness version 0.3.2 Index]