precision
precision#
- solas_disparity.precision(...)#
- This method calculates the Precision for a given set of protected and reference groups.
Also know as Precision.
Precision = True Positives / (True Positives + False Positives)
- An TPR is considered “practically significant” if the Precision is:
less than a chosen ratio_threshold.
statistically significantly different than parity, AND
greater than difference_threshold.
Note
Ratio is defined as (Precision of Protected Group) / (Precision of Reference Group)
Difference is defined as (Precision of Reference Group) - (Precision 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