solas_disparity.types.Disparity#

class solas_disparity.types.Disparity(disparity_type: solas_disparity.types._disparity_calculation.DisparityCalculation, summary_table: pandas.core.frame.DataFrame = NOTHING, protected_groups: List[str] = NOTHING, reference_groups: List[str] = NOTHING, group_categories: List[str] = NOTHING, statistical_significance: Optional[solas_disparity.types._stat_sig.StatSig] = None, smd_threshold: Optional[float] = None, residual_smd_threshold: Optional[float] = None, smd_denominator: Optional[str] = SMDDenominator.POPULATION, residual_smd_denominator: Optional[str] = ResidualSMDDenominator.POPULATION, lower_score_favorable: Optional[bool] = True, odds_ratio_threshold: Optional[float] = None, air_threshold: Optional[float] = None, percent_difference_threshold: Optional[float] = None, max_for_fishers: Optional[int] = 100, shortfall_method: Optional[solas_disparity.types._shortfall_method.ShortfallMethod] = ShortfallMethod.TO_REFERENCE_MEAN, fdr_threshold: Optional[float] = None, metric: Optional[Callable[[...], Union[int, float]]] = None, difference_calculation: Optional[solas_disparity.types._difference_calculation.DifferenceCalculation] = None, difference_threshold: Optional[float] = None, ratio_calculation: Optional[solas_disparity.types._ratio_calculation.RatioCalculation] = None, ratio_threshold: Optional[float] = None, statistical_significance_test: Optional[solas_disparity.types._stat_sig_test.StatSigTest] = None, p_value_threshold: float = 0.05, shift_zeros: bool = True, drop_small_groups: bool = True, small_group_table: pandas.core.frame.DataFrame = NOTHING, unknown_table: pandas.core.frame.DataFrame = NOTHING)#

Dataclass for disparity objects.

__init__(disparity_type: solas_disparity.types._disparity_calculation.DisparityCalculation, summary_table: pandas.core.frame.DataFrame = NOTHING, protected_groups: List[str] = NOTHING, reference_groups: List[str] = NOTHING, group_categories: List[str] = NOTHING, statistical_significance: Optional[solas_disparity.types._stat_sig.StatSig] = None, smd_threshold: Optional[float] = None, residual_smd_threshold: Optional[float] = None, smd_denominator: Optional[str] = SMDDenominator.POPULATION, residual_smd_denominator: Optional[str] = ResidualSMDDenominator.POPULATION, lower_score_favorable: Optional[bool] = True, odds_ratio_threshold: Optional[float] = None, air_threshold: Optional[float] = None, percent_difference_threshold: Optional[float] = None, max_for_fishers: Optional[int] = 100, shortfall_method: Optional[solas_disparity.types._shortfall_method.ShortfallMethod] = ShortfallMethod.TO_REFERENCE_MEAN, fdr_threshold: Optional[float] = None, metric: Optional[Callable[[...], Union[int, float]]] = None, difference_calculation: Optional[solas_disparity.types._difference_calculation.DifferenceCalculation] = None, difference_threshold: Optional[float] = None, ratio_calculation: Optional[solas_disparity.types._ratio_calculation.RatioCalculation] = None, ratio_threshold: Optional[float] = None, statistical_significance_test: Optional[solas_disparity.types._stat_sig_test.StatSigTest] = None, p_value_threshold: float = 0.05, shift_zeros: bool = True, drop_small_groups: bool = True, small_group_table: pandas.core.frame.DataFrame = NOTHING, unknown_table: pandas.core.frame.DataFrame = NOTHING) None#

Method generated by attrs for class Disparity.

Methods

__init__(disparity_type[, summary_table, ...])

Method generated by attrs for class Disparity.

show()

to_excel(file_path)

Export summary table as an XLSX file.

Attributes

affected_categories

Group categories that correspond to practically significant groups.

affected_groups

Protected groups that have practically significant adverse disparities.

affected_reference

Reference groups that correspond to practically significant groups.

plot

disparity_type

Type of disparity calculation.

summary_table

Summary table of disparity calculation results.

protected_groups

Protected group names.

reference_groups

Reference group names.

group_categories

Group category names.

statistical_significance

StatSig object.

smd_threshold

Standardized mean difference threshold.

residual_smd_threshold

Residual Standardized mean difference threshold.

smd_denominator

Standardized mean difference denominator.

residual_smd_denominator

Residual standardized mean difference denominator.

lower_score_favorable

Is a lower pre-transformation prediction favorable? If True, then the model's predictions are assumed to be more favorable the lower the value.

odds_ratio_threshold

Odds ratio threshold.

air_threshold

AIR threshold.

percent_difference_threshold

Percent difference threshold value.

max_for_fishers

Max value of samples for Fishers Exact test to be used.

fdr_threshold

False discovery rate threshold for use when calculating segment-level results are statistically significant using the Benjamani-Hochberg Procedure.

ratio_calculation

Ratio Calculation.

ratio_threshold

Ratio threshold as float set only for curated custom disparity metrics such as FDR.

difference_calculation

Difference Calculation.

difference_threshold

Difference threshold as a float set only for curated custom disparity metrics such as FDR.

statistical_significance_test

Statistical Significance Method