Skip to content

Commit

Permalink
Merge pull request #2 from deGravity/master
Browse files Browse the repository at this point in the history
Fixed f-score computation for beta != 1.
  • Loading branch information
hhromic authored Oct 20, 2016
2 parents db32e48 + a8d6c3b commit 405ad12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bcubed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

def fscore(p_val, r_val, beta=1.0):
"""Computes the F_{beta}-score of given precision and recall values."""
return (1.0 + beta) * (p_val * r_val / (beta**2 * p_val + r_val))
return (1.0 + beta**2) * (p_val * r_val / (beta**2 * p_val + r_val))

0 comments on commit 405ad12

Please sign in to comment.