binary_label_dataset_metric: Binary Label Dataset Metric

Description Usage Arguments See Also Examples

View source: R/binary_label_dataset_metric.R

Description

Class for computing metrics on an aif360 compatible dataset with binary labels.

Usage

1
binary_label_dataset_metric(data, privileged_groups, unprivileged_groups)

Arguments

data

A aif360 compatible dataset.

privileged_groups

Privileged groups. List containing privileged protected attribute name and value of the privileged protected attribute.

unprivileged_groups

Unprivileged groups. List containing unprivileged protected attribute name and value of the unprivileged protected attribute.

See Also

Explore available binary label dataset metrics here

Available metrics are: base_rate, consistency, disparate_impact, mean_difference, num_negatives, num_positives and statistical_parity_difference.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
load_aif360_lib()
# Load the adult dataset
adult_dataset <- adult_dataset()

# Define the groups
privileged_groups <- list("race", 1)
unprivileged_groups <- list("race", 0)

# Metric for Binary Label Dataset
bm <- binary_label_dataset_metric(data = adult_dataset,
                                  privileged_groups = privileged_groups,
                                  unprivileged_groups = unprivileged_groups)

# Difference in mean outcomes between unprivileged and privileged groups
bm$mean_difference()

aif360 documentation built on July 1, 2020, 5:34 p.m.