Skip to content

Commit

Permalink
fixed label shapes to be (n, 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmansc authored and Illia-Kryvoviaz committed Jun 7, 2023
1 parent 1b78249 commit e06b11a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aif360/algorithms/inprocessing/meta_fair_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def predict(self, dataset):
scores.append((t+1)/2)

pred_dataset = dataset.copy()
pred_dataset.labels = np.array([predictions])
pred_dataset.scores = np.array([scores])
pred_dataset.labels = np.array([predictions]).T
pred_dataset.scores = np.array([scores]).T

return pred_dataset
4 changes: 2 additions & 2 deletions aif360/algorithms/inprocessing/prejudice_remover.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def predict(self, dataset):
all_sensitive_attributes, self.sensitive_attr, None)

pred_dataset = dataset.copy()
pred_dataset.labels = predictions
pred_dataset.scores = scores
pred_dataset.labels = predictions[:, np.newaxis]
pred_dataset.scores = scores[:, np.newaxis]

return pred_dataset

Expand Down

0 comments on commit e06b11a

Please sign in to comment.