Spaces:
Sleeping
Sleeping
Fahad Ebrahim
commited on
Commit
·
42bbb6d
1
Parent(s):
545dc2a
Score of 1.5
Browse files- fbeta_score.py +3 -3
fbeta_score.py
CHANGED
@@ -65,7 +65,7 @@ Examples:
|
|
65 |
|
66 |
Example 1-A simple binary example
|
67 |
>>> fbeta_score = evaluate.load("leslyarun/fbeta_score")
|
68 |
-
>>> results = fbeta_score.compute(references=[0, 1], predictions=[0, 1], beta=
|
69 |
>>> print(results)
|
70 |
{'f_beta_score': 1.0}
|
71 |
"""
|
@@ -93,10 +93,10 @@ class F_Beta(evaluate.Metric):
|
|
93 |
)
|
94 |
|
95 |
|
96 |
-
def _compute(self, predictions, references, beta=
|
97 |
score = fbeta_score(
|
98 |
references, predictions, beta=beta, labels=labels, pos_label=pos_label, average=average, sample_weight=sample_weight
|
99 |
)
|
100 |
return {"f_beta_score": float(score) if score.size == 1 else score}
|
101 |
|
102 |
-
|
|
|
65 |
|
66 |
Example 1-A simple binary example
|
67 |
>>> fbeta_score = evaluate.load("leslyarun/fbeta_score")
|
68 |
+
>>> results = fbeta_score.compute(references=[0, 1], predictions=[0, 1], beta=1.5)
|
69 |
>>> print(results)
|
70 |
{'f_beta_score': 1.0}
|
71 |
"""
|
|
|
93 |
)
|
94 |
|
95 |
|
96 |
+
def _compute(self, predictions, references, beta=1.5, labels=None, pos_label=1, average="binary", sample_weight=None):
|
97 |
score = fbeta_score(
|
98 |
references, predictions, beta=beta, labels=labels, pos_label=pos_label, average=average, sample_weight=sample_weight
|
99 |
)
|
100 |
return {"f_beta_score": float(score) if score.size == 1 else score}
|
101 |
|
102 |
+
|