Predictive Parity

Overview

Calculates PPV and NPV difference and ratio between priv and unpriv groups.

Return

((PPV difference, PPV ratio), (NPV difference, NPV ratio))

Source

Usage

Manually

tup = predictive_parity(df, protected_attribute, privileged_group, labels, positive_label, y_true)
print(tup)

Using Fairness Object

tup = (fo.compute(predictive_parity))

Results

((0.0, 1.0), (0.6333333333234445, 4.166666666680556))

These results are obtained by using the input data given in the Create Example Data page under Getting Started

Interpretation

The Parity Difference metric quantifies the difference in performance between two groups or populations based on a chosen performance metric. A positive Parity Difference indicates that the first group has a higher performance metric compared to the second group, while a negative value indicates the opposite.

The Parity Ratio metric quantifies the ratio of performance between two groups or populations based on a chosen performance metric. A parity ratio greater than 1 indicates that the first group has a higher performance metric compared to the second group, while a ratio less than 1 indicates the opposite.