Skip to content

Commit

Permalink
fixed duplicate calculation of spearmanr function in metrics wrapper. (
Browse files Browse the repository at this point in the history
  • Loading branch information
benlipkin authored Jul 7, 2022
1 parent f62ad7c commit 4f4e17d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions metrics/spearmanr/spearmanr.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@ def _info(self):
)

def _compute(self, predictions, references, return_pvalue=False):
results = spearmanr(references, predictions)
if return_pvalue:
return {
"spearmanr": spearmanr(references, predictions)[0],
"spearmanr_pvalue": spearmanr(references, predictions)[1],
}
return {"spearmanr": results[0], "spearmanr_pvalue": results[1]}
else:
return {
"spearmanr": spearmanr(references, predictions)[0],
}
return {"spearmanr": results[0]}

0 comments on commit 4f4e17d

Please sign in to comment.