DisparityResponse#

class solas_disparity.types.DisparityResponse(...)#

Methods

__init__

Create a new model by parsing and validating input data from keyword arguments.

construct

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy

Duplicate a model, optionally choose which fields to include, exclude and change.

dict

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

from_disparity

from_orm

json

Generate a JSON representation of the model, include and exclude arguments as per dict().

parse_file

parse_obj

parse_raw

schema

schema_json

update_forward_refs

Try to update ForwardRefs on fields based on this Model, globalns and localns.

validate

Attributes

metadata

disparity_type

Type of disparity calculation performed.

summary_table_json

Summary table of disparity calculation results.

summary_table_json_flat

Summary table of disparity calculation results.

protected_groups

Protected group names.

reference_groups

Reference group names.

group_categories

Group category names.

outcome

Column containing ordinal value of each category

air_threshold

AIR threshold.

percent_difference_threshold

Percent difference threshold value.

label

A string representing the name of the label column in group_data.

sample_weight

A string representing the name of the column in group_data.

max_for_fishers

The maximum number of groups that can be used for Fisher's Exact Test.

shortfall_method

smd_threshold

Standardized mean difference threshold.

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.

smd_denominator

The denominator used for the SMD calculation.

plot_json

Plot of disparity calculation results.

air_threshold: Optional[float]#

AIR threshold. Set by the user, this takes a float that represents the AIR level below which Solas will identify as being indicative of a practically significant disparity. Legal and compliance counsel should be sought for the appropriate AIR threshold in a given use case.

disparity_type: solas_disparity.types._disparity_calculation.DisparityCalculation#

Type of disparity calculation performed.

group_categories: List[str]#

Group category names. Same length as protected_groups. Set by the user, this takes a list of strings which represent the reference groups (also known as control groups) being analyzed. There must be a one-to-one correspondence between reference groups and protected_groups. Note that the protected groups and reference groups are aligned by index in the lists.

label: Optional[str]#

A string representing the name of the label column in group_data.

lower_score_favorable: Optional[bool]#

Is a lower pre-transformation prediction favorable? If True, then the model’s predictions are assumed to be more favorable the lower the value. If False, then the model’s predictions are assumed to be more favorable the higher the value. Optional. If omitted, defaults to True.

max_for_fishers: Optional[int]#

The maximum number of groups that can be used for Fisher’s Exact Test. If the number of groups is greater than this value, Fisher’s Exact Test will not be used. Instead, the chi-squared test will be used.

outcome: Optional[str]#

Column containing ordinal value of each category

percent_difference_threshold: Optional[float]#

Percent difference threshold value. For example, if percent_difference_threshold = 0.2, then the difference in percent favorable will need to exceed 20% for a result to be practically significant.

plot_json: Optional[str]#

Plot of disparity calculation results. Provided as a Plotly json definition.

protected_groups: List[str]#

Protected group names. Set by the user, this takes a list of strings which represent the protected groups being analyzed. There can be as few as one protected group and there is no upper limit to the number of protected groups that can be analyzed.

reference_groups: List[str]#

Reference group names. Same length as protected_groups. Set by the user, this takes a list of strings which represent the reference groups (also known as control groups) being analyzed. There must be a one-to-one correspondence between reference groups and protected_groups. Note that the protected groups and reference groups are aligned by index in the lists.

sample_weight: Optional[str]#

A string representing the name of the column in group_data.

smd_denominator: Optional[solas_disparity.types._smd_denominator.SMDDenominator]#

The denominator used for the SMD calculation.

smd_threshold: Optional[float]#

Standardized mean difference threshold. Set by the user, this takes a float that represents the SMD level which Solas will identify as being indicative of a practically significant disparity. Legal and compliance counsel should be sought for the appropriate SMD threshold in a given use case.

summary_table_json: str#

Summary table of disparity calculation results. Provided as a Pandas DataFrame in json format.

summary_table_json_flat: str#

Summary table of disparity calculation results. Provided as a list of dictionaries. Each dictionary represents a row in the table. Provides a flat representation of the table.