Skip to content

Commit

Permalink
removing useless logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandut committed Jun 12, 2024
1 parent 07949fe commit e4f6988
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions flamby/datasets/fed_synthetic/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
def metric(y_true, y_pred):
y_true = y_true.astype("uint8")
y_pred = np.argmax(y_pred, axis=1)
# The try except is needed because when the metric is batched some batches
# have one class only
try:
return accuracy_score(y_true, y_pred)
except ValueError:
return np.nan
return accuracy_score(y_true, y_pred)

0 comments on commit e4f6988

Please sign in to comment.