Skip to content

Commit

Permalink
Fix data type in Matthews correlation coefficient calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
fcogidi committed Feb 20, 2024
1 parent 18b0686 commit 7c33227
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _mcc_reduce(confmat: Array) -> Array:
denom = (tp + fp + eps) * (tp + fn + eps) * (tn + fp + eps) * (tn + fn + eps)
elif denom == 0:
return xp.asarray(0.0, dtype=xp.float32, device=apc.device(confmat)) # type: ignore[no-any-return]
return xp.astype(numerator / xp.sqrt(denom), xp.float64) # type: ignore[no-any-return]
return xp.astype(numerator / xp.sqrt(denom), xp.float32) # type: ignore[no-any-return]


def binary_mcc(
Expand Down

0 comments on commit 7c33227

Please sign in to comment.