add multi-label usage example to docstrsing

#3
by fcakyon - opened
Files changed (1) hide show
  1. f1.py +6 -0
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