(
    favorable_labels, protected_attributes, unfavorable_labels=None
)
return _ScorerFactory(
        "equal_opportunity_difference",
        favorable_labels,
        protected_attributes,
        unfavorable_labels,
    )
r"""
    Create a scikit-learn compatible `equal opportunity difference`_
    scorer given the fairness info. Difference of true positive rates
    between the unprivileged and the privileged groups. The true
    positive rate is the ratio of true positives to the total number
    of actual positives for a given group.

    .. math::
        \text{TPR}_{D = \text{unprivileged}} - \text{TPR}_{D = \text{privileged}}

    The ideal value is 0. A value of <0 implies disparate benefit for the
    privileged group and a value >0 implies disparate benefit for the
    unprivileged group. Fairness for this metric is between -0.1 and 0.1.

    .. _`equal opportunity difference`: https://aif360.readthedocs.io/en/latest/modules/generated/aif360.metrics.ClassificationMetric.html#aif360.metrics.ClassificationMetric.equal_opportunity_difference
r"""
    Create a scikit-learn compatible `equal opportunity difference`_
    scorer given the fairness info. Difference of true positive rates
    between the unprivileged and the privileged groups. The true
    positive rate is the ratio of true positives to the total number
    of actual positives for a given group.
r Create a scikit - learn compatible equal opportunity difference _ scorer given the fairness info . Difference of true positive rates between the unprivileged and the privileged groups . The true positive rate is the ratio of true positives to the total number of actual positives for a given group .
def equal_opportunity_difference(
    favorable_labels, protected_attributes, unfavorable_labels=None
):
    r"""
    Create a scikit-learn compatible `equal opportunity difference`_
    scorer given the fairness info. Difference of true positive rates
    between the unprivileged and the privileged groups. The true
    positive rate is the ratio of true positives to the total number
    of actual positives for a given group.

    .. math::
        \text{TPR}_{D = \text{unprivileged}} - \text{TPR}_{D = \text{privileged}}

    The ideal value is 0. A value of <0 implies disparate benefit for the
    privileged group and a value >0 implies disparate benefit for the
    unprivileged group. Fairness for this metric is between -0.1 and 0.1.

    .. _`equal opportunity difference`: https://aif360.readthedocs.io/en/latest/modules/generated/aif360.metrics.ClassificationMetric.html#aif360.metrics.ClassificationMetric.equal_opportunity_difference"""
    return _ScorerFactory(
        "equal_opportunity_difference",
        favorable_labels,
        protected_attributes,
        unfavorable_labels,
    )
def equal_opportunity_difference ( favorable_labels , protected_attributes , unfavorable_labels = None ) : return _ScorerFactory ( "equal_opportunity_difference" , favorable_labels , protected_attributes , unfavorable_labels , )