From d54e51daa680449a8f7a620bed8cbcdd4a557a78 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 25 Jun 2018 15:58:34 +0800 Subject: [PATCH] change predictions to preds --- python/paddle/fluid/metrics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/metrics.py b/python/paddle/fluid/metrics.py index 37c312a776..17bb0826a6 100644 --- a/python/paddle/fluid/metrics.py +++ b/python/paddle/fluid/metrics.py @@ -580,10 +580,10 @@ class Auc(MetricBase): self.tn_list = np.zeros((num_thresholds, )) self.fp_list = np.zeros((num_thresholds, )) - def update(self, predictions, labels): + def update(self, preds, labels): if not _is_numpy_(labels): raise ValueError("The 'labels' must be a numpy ndarray.") - if not _is_numpy_(predictions): + if not _is_numpy_(preds): raise ValueError("The 'predictions' must be a numpy ndarray.") kepsilon = 1e-7 # to account for floating point imprecisions @@ -596,12 +596,12 @@ class Auc(MetricBase): tp, fn, tn, fp = 0, 0, 0, 0 for i, lbl in enumerate(labels): if lbl: - if predictions[i, 1] >= thresh: + if preds[i, 1] >= thresh: tp += 1 else: fn += 1 else: - if predictions[i, 1] >= thresh: + if preds[i, 1] >= thresh: fp += 1 else: tn += 1 -- GitLab