Skip to contents

A fairness tensor is a list of groupwise confusion matrices.

Usage

fairness_tensor(object, ...)

# S3 method for data.table
fairness_tensor(object, task, ...)

# S3 method for PredictionClassif
fairness_tensor(object, task, ...)

# S3 method for ResampleResult
fairness_tensor(object, ...)

Arguments

object

(data.table() | PredictionClassif | ResampleResult)
A data.table with columns truth and prediction, a PredictionClassif or a ResampleResult.

...

any
Currently not used.

task

(TaskClassif)
A TaskClassif. Needs col_role "pta" to be set.

Value

list() of confusion matrix for every group in "pta".

Examples

task = tsk("compas")
prediction = lrn("classif.rpart")$train(task)$predict(task)
fairness_tensor(prediction, task)
#> $Male
#>         truth
#> response    0    1
#>        0 2442    0
#>        1  159 2396
#> 
#> $Female
#>         truth
#> response   0   1
#>        0 740   0
#>        1  22 413
#>