true_negative_rate#

solas_disparity.disparity.true_negative_rate(...)#
This method calculates the True Negative Rate (TNR) for a given set of protected and reference groups.

Also know as Specificity or Selectivity.

True Negative Rate (TNR) = True Negatives / (True Negatives + False Positives)

An TPR is considered “practically significant” if the TNR is:
  1. less than a chosen ratio_threshold.

  2. statistically significantly different than parity, AND

  3. greater than difference_threshold.

Note

Ratio is defined as (TNR of Protected Group) / (TNR of Reference Group)

Difference is defined as (TNR of Reference Group) - (TNR 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

Disparity