fairness_tensor {mlr3fairness} | R Documentation |
Compute the Fairness Tensor given a Prediction and a Task
Description
A fairness tensor is a list of groupwise confusion matrices.
Usage
fairness_tensor(object, normalize = "all", ...)
## S3 method for class 'data.table'
fairness_tensor(object, normalize = "all", task, ...)
## S3 method for class 'PredictionClassif'
fairness_tensor(object, normalize = "all", task, ...)
## S3 method for class 'ResampleResult'
fairness_tensor(object, normalize = "all", ...)
Arguments
object |
( |
normalize |
( |
... |
|
task |
(TaskClassif) |
Value
list()
of confusion matrix for every group in "pta"
.
Protected Attributes
The protected attribute is specified as a col_role
in the corresponding Task()
:
<Task>$col_roles$pta = "name_of_attribute"
This also allows specifying more than one protected attribute,
in which case fairness will be considered on the level of intersecting groups defined by all columns
selected as a predicted attribute.
Examples
library("mlr3")
task = tsk("compas")
prediction = lrn("classif.rpart")$train(task)$predict(task)
fairness_tensor(prediction, task = task)