True Positive Rate

Overview

Calculates TP / (TP + FN) for privileged and unprivileged groups. This is the probability that a positive prediction is truly positive.

Formula

TPR = TP / (TP + FN)

Where:

  • TP (True Positives): The number of positive instances correctly predicted by the model

  • FN (False Negatives): The number of negatives instances incorrectly predicted as positive by the model

Usage

Manually


tpr_priv, tpr_unpriv = true_positive_rate(df, protected_attribute, privileged_group, labels, positive_label, y_true)



print("True Positive Rate for privileged group:", tpr_priv)

print("True Positive Rate for unprivileged group:", tpr_unpriv)

Using Fairness Object

tpr_priv, tpr_unpriv = (fo.compute(true_positive_rate))

Results

True Positive Rate for privileged group: 0.6666666666444444
True Positive Rate for unprivileged group: 0.33333333332777776

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

Interpretation

A higher TPR indicates that the positives are being correctly assigned as such.