Spaces:
Running
Running
Fatih
commited on
Commit
•
31dbab2
1
Parent(s):
e1c4a29
add multi-label usage example to docstrsing
Browse files
f1.py
CHANGED
@@ -78,6 +78,12 @@ Examples:
|
|
78 |
>>> results = f1_metric.compute(predictions=predictions, references=references, average=None)
|
79 |
>>> print(results)
|
80 |
{'f1': array([0.8, 0. , 0. ])}
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
"""
|
82 |
|
83 |
|
|
|
78 |
>>> results = f1_metric.compute(predictions=predictions, references=references, average=None)
|
79 |
>>> print(results)
|
80 |
{'f1': array([0.8, 0. , 0. ])}
|
81 |
+
|
82 |
+
Example 5-A multi-label example
|
83 |
+
>>> f1_metric = evaluate.load("f1", "multilabel")
|
84 |
+
>>> results = f1_metric.compute(predictions=[[0, 1, 1], [1, 1, 0]], references=[[0, 1, 1], [0, 1, 0]], average="macro")
|
85 |
+
>>> print(round(results['f1'], 2))
|
86 |
+
0.67
|
87 |
"""
|
88 |
|
89 |
|