mlr_pipeops_equalized_odds | R Documentation |
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.
R6Class object inheriting from PipeOpTaskPreproc
/PipeOp
.
PipeOpEOd*$new(id = "eod", param_vals = list())
id
(character(1))
.
param_vals
(list()
)
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.
The $state
is a named list
with the $state
elements inherited from PipeOpTaskPreproc.
alpha
(numeric()
): A number between 0 (no debiasing) and 1 (full debiasing).
Controls the debiasing strength by multiplying the flipping probabilities with alpha.
privileged
(character()
): The privileged group.
Only fields inherited from PipeOpTaskPreproc/PipeOp
.
Methods inherited from PipeOpTaskPreproc/PipeOp.
mlr3pipelines::PipeOp
-> PipeOpEOd
new()
Creates a new instance of this [R6][R6::R6Class][PipeOp] R6 class.
PipeOpEOd$new(id = "EOd", param_vals = list())
id
character
The PipeOps identifier in the PipeOps library.
param_vals
list
The parameter values to be set. See Parameters
.
clone()
The objects of this class are cloneable with this method.
PipeOpEOd$clone(deep = FALSE)
deep
Whether to make a deep clone.
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.
https://mlr3book.mlr-org.com/list-pipeops.html
Other PipeOps:
mlr_pipeops_explicit_pta
,
mlr_pipeops_reweighing
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.