Skip to content

Commit

Permalink
add multilabel f1 eval usage (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Aug 3, 2022
1 parent 1e67b71 commit 0b8be61
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metrics/f1/f1.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
>>> results = f1_metric.compute(predictions=predictions, references=references, average=None)
>>> print(results)
{'f1': array([0.8, 0. , 0. ])}
Example 5-A multi-label example
>>> f1_metric = evaluate.load("f1", "multilabel")
>>> results = f1_metric.compute(predictions=[[0, 1, 1], [1, 1, 0]], references=[[0, 1, 1], [0, 1, 0]], average="macro")
>>> print(round(results['f1'], 2))
0.67
"""


Expand Down

0 comments on commit 0b8be61

Please sign in to comment.