MeasureFairnessComposite | R Documentation |
Computes a composite measure from multiple fairness metrics and aggregates them
using aggfun
(defaulting to mean()
).
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.
mlr3::Measure
-> MeasureFairnessComposite
new()
Creates a new instance of this R6 class.
MeasureFairnessComposite$new( id = NULL, measures, aggfun = function(x) mean(x), operation = groupdiff_absdiff, minimize = TRUE, range = c(-Inf, Inf) )
id
(character(1)
)
Id of the measure. Defaults to the concatenation of ids in measure
.
measures
(list of MeasureFairness)
List of fairness measures to aggregate.
aggfun
(function()
)
Aggregation function used to aggregate results from respective measures. Defaults to sum
.
operation
(function()
)
The operation used to compute the difference. A function that returns
a single value given input: computed metric for each subgroup.
Defaults to groupdiff_absdiff
.
See MeasureFairness
for more information.
minimize
(logical(1)
)
Should the measure be minimized? Defaults to TRUE
.
range
(numeric(2)
)
Range of the resulting measure. Defaults to c(-Inf, Inf)
.
clone()
The objects of this class are cloneable with this method.
MeasureFairnessComposite$clone(deep = FALSE)
deep
Whether to make a deep clone.
library("mlr3")
# Equalized Odds Metric
MeasureFairnessComposite$new(measures = msrs(c("fairness.fpr", "fairness.tpr")))
# Other metrics e.g. based on negative rates
MeasureFairnessComposite$new(measures = msrs(c("fairness.fnr", "fairness.tnr")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.