ModelingBiasFairnessConfig#

class datarobotx.ModelingBiasFairnessConfig(bias_mitigation_feature_name=None, bias_mitigation_technique=None, protected_features=None, fairness_metrics_set=None, fairness_threshold=None, include_bias_mitigation_feature_as_predictor_variable=None)#

Bias and Fairness modeling options.

Parameters that default to ‘None’ (or are omitted by the user) are overridden to server-side defaults at runtime. Consult the DataRobot REST API and GUI documentation for additional information on each parameter.

Parameters:
  • bias_mitigation_feature_name (str) – The name of the protected feature used to mitigate bias on models.

  • bias_mitigation_technique ({'preprocessingReweighing', 'postProcessingRejectionOptionBasedClassification'}) – Method applied to perform bias mitigation.

  • protected_features (list of str) – A list of project feature to mark as protected for Bias metric calculation and Fairness correction. Used and required only if Bias & Fairness in AutoML feature is enabled.

  • fairness_metrics_set ({'proportionalParity', 'equalParity', 'predictionBalance',) – ‘trueFavorableAndUnfavorableRateParity’, ‘favorableAndUnfavorablePredictiveValueParity’} Metric to use for calculating fairness. Can be one of proportionalParity, equalParity, predictionBalance, trueFavorableAndUnfavorableRateParity or FavorableAndUnfavorablePredictiveValueParity. Used and required only if Bias & Fairness in AutoML feature is enabled.

  • fairness_threshold (float) – Threshold value of the fairness metric. Can be in a range of [0:1]. If the actual metric value is below the threshold, the user will be notified

  • include_bias_mitigation_feature_as_predictor_variable (bool) – Specifies whether the mitigation feature will be used as a predictor variable (i.e., treated like other categorical features in the input to train the modeler), in addition to being used for bias mitigation. If false, the mitigation feature will be used only for bias mitigation, and not for training the modeler task.

See also

DRConfig

Configuration object for DataRobot project and autopilot settings, also includes detailed examples of usage

Attributes:

bias_mitigation_feature_name

The name of the protected feature used to mitigate bias on models.

bias_mitigation_technique

Method applied to perform bias mitigation.

fairness_metrics_set

Metric to use for calculating fairness.

fairness_threshold

Threshold value of the fairness metric.

include_bias_mitigation_feature_as_predictor_variable

Specifies whether the mitigation feature will be used as a predictor variable (i.e., treated like other categorical features in the input to train the modeler), in addition to being used for bias mitigation.

protected_features

A list of project feature to mark as protected for Bias metric calculation and Fairness correction.

Inherited methods:

keys()

rtype:

Collection[str]

to_dict()

Return configuration as a dict.

property bias_mitigation_feature_name: str#

The name of the protected feature used to mitigate bias on models.

Notes

bias_mitigation_feature_name : str

property bias_mitigation_technique: str#

Method applied to perform bias mitigation.

Notes

bias_mitigation_technique : {‘preprocessingReweighing’, ‘postProcessingRejectionOptionBasedClassification’}

property fairness_metrics_set: str#

Metric to use for calculating fairness. Can be one of proportionalParity, equalParity, predictionBalance, trueFavorableAndUnfavorableRateParity or FavorableAndUnfavorablePredictiveValueParity. Used and required only if Bias & Fairness in AutoML feature is enabled.

Notes

fairness_metrics_set{‘proportionalParity’, ‘equalParity’, ‘predictionBalance’,

‘trueFavorableAndUnfavorableRateParity’, ‘favorableAndUnfavorablePredictiveValueParity’}

property fairness_threshold: float#

Threshold value of the fairness metric. Can be in a range of [0:1]. If the actual metric value is below the threshold, the user will be notified.

Notes

fairness_threshold : float

property include_bias_mitigation_feature_as_predictor_variable: bool#

Specifies whether the mitigation feature will be used as a predictor variable (i.e., treated like other categorical features in the input to train the modeler), in addition to being used for bias mitigation. If false, the mitigation feature will be used only for bias mitigation, and not for training the modeler task.

Notes

include_bias_mitigation_feature_as_predictor_variable : bool

property protected_features: List[str]#

A list of project feature to mark as protected for Bias metric calculation and Fairness correction. Used and required only if Bias & Fairness in AutoML feature is enabled.

Notes

protected_features : list of str

to_dict()#

Return configuration as a dict.

Return type:

Dict[str, Any]