lale.lib.aif360.reject_option_classification module

class lale.lib.aif360.reject_option_classification.RejectOptionClassification(*, favorable_labels, protected_attributes, unfavorable_labels=None, estimator, redact=True, low_class_thresh=0.01, high_class_thresh=0.99, num_class_thresh=100, num_ROC_margin=50, metric_name='Statistical parity difference', metric_ub=0.05, metric_lb=-0.05, repair_level=None)

Bases: PlannedIndividualOp

Reject option classification post-estimator fairness mitigator. Gives favorable outcomes to unpriviliged groups and unfavorable outcomes to priviliged groups in a confidence band around the decision boundary with the highest uncertainty (Kamiran et al. 2012).

This documentation is auto-generated from JSON schemas.

Parameters
  • favorable_labels (array, >=1 items, not for optimizer) –

    Label values which are considered favorable (i.e. “positive”).

    • items : union type

      • float

        Numerical value.

      • or string

        Literal string value.

      • or boolean

        Boolean value.

      • or array, >=2 items, <=2 items of items : float

        Numeric range [a,b] from a to b inclusive.

  • protected_attributes (array, >=1 items, not for optimizer) –

    Features for which fairness is desired.

    • items : dict

      • feature : union type

        Column name or column index.

        • string

        • or integer

      • reference_group : array, >=1 items

        Values or ranges that indicate being a member of the privileged group.

        • items : union type

          • string

            Literal value.

          • or float

            Numerical value.

          • or array, >=2 items, <=2 items of items : float

            Numeric range [a,b] from a to b inclusive.

      • monitored_group : union type, default None

        Values or ranges that indicate being a member of the unprivileged group.

        • None

          If monitored_group is not explicitly specified, consider any values not captured by reference_group as monitored.

        • or array, >=1 items

          • items : union type

            • string

              Literal value.

            • or float

              Numerical value.

            • or array, >=2 items, <=2 items of items : float

              Numeric range [a,b] from a to b inclusive.

  • unfavorable_labels (union type, not for optimizer, default None) –

    Label values which are considered unfavorable (i.e. “negative”).

    • None

      If unfavorable_labels is not explicitly specified, consider any labels not captured by favorable_labels as unfavorable.

    • or array, >=1 items

      • items : union type

        • float

          Numerical value.

        • or string

          Literal string value.

        • or boolean

          Boolean value.

        • or array, >=2 items, <=2 items of items : float

          Numeric range [a,b] from a to b inclusive.

  • estimator (operator, not for optimizer) – Nested supervised learning operator for which to mitigate fairness.

  • redact (boolean, not for optimizer, default True) – Whether to redact protected attributes before data preparation (recommended) or not.

  • low_class_thresh (float, >=0.0, <=1.0, not for optimizer, default 0.01) – Smallest classification threshold to use in the optimization.

  • high_class_thresh (float, >=0.0, <=1.0, not for optimizer, default 0.99) – Highest classification threshold to use in the optimization.

  • num_class_thresh (integer, >=1, not for optimizer, default 100) – Number of classification thresholds between low_class_thresh and high_class_thresh for the optimization search.

  • num_ROC_margin (integer, >=1, not for optimizer, default 50) – Number of relevant ROC margins to be used in the optimization search.

  • metric_name (‘Statistical parity difference’, ‘Average odds difference’, or ‘Equal opportunity difference’, default ‘Statistical parity difference’) – Name of the metric to use for the optimization.

  • metric_ub (float, >=0, <=1, not for optimizer, default 0.05) – Upper bound of constraint on the metric value.

  • metric_lb (float, >=-1, <=0, not for optimizer, default -0.05) – Lower bound of constraint on the metric value.

  • repair_level (union type, optional, not for optimizer, default None) –

    Repair amount from 0 = none to 1 = full.

    • None

      Keep metric_lb and metric_ub unchanged.

    • or float, >=0, <=1

      Set metric_ub = 1 - repair_level and metric_lb = - metric_ub.

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array) –

    Features; the outer array is over samples.

    • items : array

      • items : union type

        • float

        • or string

  • y (union type) –

    Target class labels; the array is over samples.

    • array of items : float

    • or array of items : string

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array) –

Features; the outer array is over samples.

  • items : array

    • items : union type

      • float

      • or string

Returns

result – Predicted class label per sample.

  • array of items : float

  • or array of items : string

Return type

union type

predict_proba(X)

Probability estimates for all classes.

Note: The predict_proba method is not available until this operator is trained.

Once this method is available, it will have the following signature: