Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Hoffman <hoffman.sc@gmail.com>
  • Loading branch information
hoffmansc committed Jul 21, 2022
1 parent 9d5a8dd commit 2e93e9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 4 additions & 3 deletions aif360/sklearn/inprocessing/grid_search_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ def fit(self, X, y):
if self.drop_prot_attr:
X = X.drop(self.prot_attr, axis=1)

le = LabelEncoder()
y = le.fit_transform(y)
self.classes_ = le.classes_
if isinstance(self.model_.constraints, red.ClassificationMoment):
le = LabelEncoder()
y = le.fit_transform(y)
self.classes_ = le.classes_

self.model_.fit(X, y, sensitive_features=A)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@
}
],
"source": [
"exp_grad_red.model._n_oracle_calls"
"exp_grad_red.model_._n_oracle_calls"
]
},
{
Expand Down Expand Up @@ -1033,7 +1033,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3.9.7 ('aif360')",
"language": "python",
"name": "python3"
},
Expand All @@ -1047,7 +1047,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.9.7"
},
"vscode": {
"interpreter": {
"hash": "d0c5ced7753e77a483fec8ff7063075635521cce6e0bd54998c8f174742209dd"
}
}
},
"nbformat": 4,
Expand Down

0 comments on commit 2e93e9c

Please sign in to comment.