Skip to content

Commit 3f5a251

Browse files
author
Hugo Hromic
committed
Add documentation to the fscore function
1 parent 984b9ae commit 3f5a251

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

bcubed/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,15 @@
2323
from bcubed.extended import recall
2424

2525
def fscore(p_val, r_val, beta=1.0):
26-
"""Computes the F_{beta}-score of given precision and recall values."""
26+
"""Computes the F_{beta}-score of given precision and recall values.
27+
28+
Parameters
29+
==========
30+
p_val: float
31+
The precision value to use for the F-score
32+
r_val: float
33+
The recall value to to use for the F-score
34+
beta: float
35+
The beta parameter for computing the F-score
36+
"""
2737
return (1.0 + beta**2) * (p_val * r_val / (beta**2 * p_val + r_val))

bcubed/extended.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def mult_recall(el1, el2, cdict, ldict):
3333

3434
def precision(cdict, ldict):
3535
"""Computes overall extended BCubed precision for the C and L dicts.
36-
36+
3737
Parameters
3838
==========
3939
cdict: dict(item: set(cluster-ids))
@@ -46,7 +46,7 @@ def precision(cdict, ldict):
4646

4747
def recall(cdict, ldict):
4848
"""Computes overall extended BCubed recall for the C and L dicts.
49-
49+
5050
Parameters
5151
==========
5252
cdict: dict(item: set(cluster-ids))

0 commit comments

Comments
 (0)