Skip to content

Commit 031e59e

Browse files
committed
docs: Change suggestion for EqualOpportunityClassifier
1 parent c176906 commit 031e59e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sklego/linear_model.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ class DemographicParityClassifier(LinearClassifierMixin, BaseEstimator):
691691
692692
!!! warning
693693
We suggest to use
694-
[fairlearn `ThresholdOptimizer`](https://fairlearn.org/v0.12/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html)
694+
[fairlearn `ThresholdOptimizer`](https://fairlearn.org/v0.13/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html)
695695
with `constraints='demographic_parity'` in combination with scikit-learn `LogisticRegression` instead of
696696
scikit-lego `DemographicParityClassifier` implementation:
697697
@@ -803,7 +803,7 @@ def __init__(
803803
msg = (
804804
"Please consider using fairlearn `ThresholdOptimizer` with `constraints='demographic_parity'` in "
805805
"combination with scikit-learn `LogisticRegression` instead.\n\n"
806-
"Docs: https://fairlearn.org/v0.12/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html"
806+
"Docs: https://fairlearn.org/v0.13/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html"
807807
)
808808
warn(msg, UserWarning)
809809
super().__init__(
@@ -835,9 +835,9 @@ class EqualOpportunityClassifier(LinearClassifierMixin, BaseEstimator):
835835
836836
!!! warning
837837
We suggest to use
838-
[fairlearn `ThresholdOptimizer`](https://fairlearn.org/v0.12/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html)
839-
with `constraints='equalized_odds'` (closest equivalent to equal opportunity) in combination with scikit-learn
840-
`LogisticRegression` instead of scikit-lego `EqualOpportunityClassifier` implementation:
838+
[fairlearn `ThresholdOptimizer`](https://fairlearn.org/v0.13/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html)
839+
with `constraints='true_positive_rate_parity'` in combination with scikit-learn `LogisticRegression` instead of
840+
scikit-lego `EqualOpportunityClassifier` implementation:
841841
842842
```py
843843
from fairlearn.postprocessing import ThresholdOptimizer
@@ -846,7 +846,7 @@ class EqualOpportunityClassifier(LinearClassifierMixin, BaseEstimator):
846846
unmitigated_lr = LogisticRegression().fit(X, y)
847847
postprocess_est = ThresholdOptimizer(
848848
estimator=unmitigated_lr,
849-
constraints='equalized_odds', # closest equivalent
849+
constraints='true_positive_rate_parity', # closest equivalent
850850
objective='balanced_accuracy_score',
851851
prefit=True,
852852
predict_method='predict_proba'
@@ -937,9 +937,9 @@ def __init__(
937937
train_sensitive_cols=False,
938938
):
939939
msg = (
940-
"Please consider using fairlearn `ThresholdOptimizer` with `constraints='equalized_odds'` in combination "
941-
"with scikit-learn `LogisticRegression` instead.\n\n"
942-
"Docs: https://fairlearn.org/v0.12/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html"
940+
"Please consider using fairlearn `ThresholdOptimizer` with `constraints='true_positive_rate_parity'` in"
941+
"combination " "with scikit-learn `LogisticRegression` instead.\n\n"
942+
"Docs: https://fairlearn.org/v0.13/api_reference/generated/fairlearn.postprocessing.ThresholdOptimizer.html"
943943
)
944944
warn(msg, UserWarning)
945945
super().__init__(

0 commit comments

Comments
 (0)