true_positive_rate
true_positive_rate#
- solas_disparity.disparity.true_positive_rate(...)#
- This method calculates the True Positve Rate (TPR) for a given set of protected and reference groups.
Also know as Sensitivity, Recall or Hit Rate.
True Positive Rate (TPR) = True Positives / (True Positives + False Negatives)
- An TPR is considered “practically significant” if the TPR is:
less than a chosen ratio_threshold.
statistically significantly different than parity, AND
greater than difference_threshold.
Note
Ratio is defined as (TPR of Protected Group) / (TPR of Reference Group)
Difference is defined as (TPR of Reference Group) - (TPR of Protected Group)
- Parameters
group_data (DataFrame) – Dataframe containing columns for group data.
protected_groups (List[str]) – List of protected groups.
reference_groups (List[str]) – List of reference groups with the same length as
protected_groups
.group_categories (List[str]) – List of group categories to which each protected and reference group pair belongs to (e.g. race, gender, age, etc.). Has the same length as
protected_groups
.outcome (Series) – Outcome series.
label (Optional[Series], optional) – Label, true outcome, and/or target series evaluated alongside
outcome
. Defaults to None.ratio_threshold (float) – Threshold at which a ratio is considered significant.
difference_threshold (float) – Threshold at which a difference is considered significant.
sample_weight (Optional[Series], optional) – Sample weight series. Has the same length as
group_data
. Defaults to None.statistical_significance_test (Optional[StatSigTest], optional) – Statistical significance test that will be factored into practical significance if not
None
. Defaults to None.p_value_threshold (float, optional) – Statistical significance test that will be factored into practical significance if not
None
. Defaults to None. Defaults to 0.05.statistical_significance_arguments (Dict[str, Any], optional) – A dictionary of arbitrary arguments to the statistical significance test function. Every function corresponds to a member of
StatSigTest
. Defaults to dict().
- Returns
Object containing results of the disparity calculation.
- Return type