solas_disparity.types.Disparity
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
Group categories that correspond to practically significant groups.
Protected groups that have practically significant adverse disparities.
Reference groups that correspond to practically significant groups.
plot
Type of disparity calculation.
Summary table of disparity calculation results.
Protected group names.
Reference group names.
Group category names.
StatSig object.
Standardized mean difference threshold.
Residual Standardized mean difference threshold.
Standardized mean difference denominator.
Residual standardized mean difference denominator.
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.
AIR threshold.
Percent difference threshold value.
Max value of samples for Fishers Exact test to be used.
False discovery rate threshold for use when calculating segment-level results are statistically significant using the Benjamani-Hochberg Procedure.
Ratio Calculation.
Ratio threshold as float set only for curated custom disparity metrics such as FDR.
Difference Calculation.
Difference threshold as a float set only for curated custom disparity metrics such as FDR.
Statistical Significance Method