Skip to content

Commit

Permalink
improve custom group support
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMRuss committed Oct 25, 2024
1 parent 303195d commit 55d3c0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/oxonfair/learners/fair.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,13 @@ def call_or_get_proba(predictor, data) -> np.ndarray:
if isinstance(data, dict):
data = data['data']
if callable(predictor):
return np.asarray(predictor(data))
out = np.asarray(predictor(data))
if out.ndim == 1:
width = out.max()+1
new_out = np.zeros((out.shape[0], width))
new_out[(np.arange(out.shape[0]), out)] = 1
return new_out
return out
return np.asarray(predictor.predict_proba(data))


Expand Down

0 comments on commit 55d3c0c

Please sign in to comment.