Skip to content

Commit 5f8a135

Browse files
committed
FIX: Use sk_score for true value
1 parent df9f67d commit 5f8a135

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tensorflow_addons/metrics/f_test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ def _test_sk(self, avg, beta, act, pred, threshold):
6767
res = fbeta_score(act, pred, beta, average=avg)
6868
return res
6969

70-
def _test_fbeta_score(self, actuals, preds, result, threshold=None):
70+
def _test_fbeta_score(self, actuals, preds, threshold=None):
7171
for avg in [None, 'micro', 'macro', 'weighted']:
7272
for beta_val in [0.5, 1.0, 2.0]:
7373
tf_score = self._test_tf(avg, beta_val, actuals, preds,
7474
threshold)
75-
self.assertAllClose(tf_score, result, atol=1e-5)
75+
sk_score = self._test_sk(avg, beta_val, actuals, preds,
76+
threshold)
77+
self.assertAllClose(tf_score, sk_score, atol=1e-5)
7678

7779
def test_fbeta_perfect_score(self):
7880
preds = [[0.7, 0.7, 0.7], [1, 0, 0], [0.9, 0.8, 0]]
7981
actuals = [[1, 1, 1], [1, 0, 0], [1, 1, 0]]
80-
self._test_fbeta_score(actuals, preds, 0.0, 0.66)
82+
self._test_fbeta_score(actuals, preds, 0.66)
8183

8284
def test_fbeta_worst_score(self):
8385
preds = [[0.7, 0.7, 0.7], [1, 0, 0], [0.9, 0.8, 0]]

0 commit comments

Comments
 (0)