Skip to content

Commit d54e51d

Browse files
committed
change predictions to preds
1 parent fc50800 commit d54e51d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/paddle/fluid/metrics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,10 @@ def __init__(self, name, curve='ROC', num_thresholds=200):
580580
self.tn_list = np.zeros((num_thresholds, ))
581581
self.fp_list = np.zeros((num_thresholds, ))
582582

583-
def update(self, predictions, labels):
583+
def update(self, preds, labels):
584584
if not _is_numpy_(labels):
585585
raise ValueError("The 'labels' must be a numpy ndarray.")
586-
if not _is_numpy_(predictions):
586+
if not _is_numpy_(preds):
587587
raise ValueError("The 'predictions' must be a numpy ndarray.")
588588

589589
kepsilon = 1e-7 # to account for floating point imprecisions
@@ -596,12 +596,12 @@ def update(self, predictions, labels):
596596
tp, fn, tn, fp = 0, 0, 0, 0
597597
for i, lbl in enumerate(labels):
598598
if lbl:
599-
if predictions[i, 1] >= thresh:
599+
if preds[i, 1] >= thresh:
600600
tp += 1
601601
else:
602602
fn += 1
603603
else:
604-
if predictions[i, 1] >= thresh:
604+
if preds[i, 1] >= thresh:
605605
fp += 1
606606
else:
607607
tn += 1

0 commit comments

Comments
 (0)