Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Fix undefined name in AUCMetric
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Aug 13, 2018
1 parent bf81dcb commit 6505674
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion example/sparse/factorization_machine/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def update(self, labels, preds):
label_sum = label_weight.sum()
if label_sum == 0 or label_sum == label_weight.size:
raise Exception("AUC with one class is undefined")


label_one_num = np.count_nonzero(label_weight)
label_zero_num = len(label_weight) - label_one_num
total_area = label_zero_num * label_one_num
height = 0
width = 0
Expand Down

0 comments on commit 6505674

Please sign in to comment.