diff --git a/compare.py b/compare.py index cfe29df3fbd35fd8fa19edc6f2e8cc5c5ce886d4..98b2fdbd7788f9d86addc90ab8d8bc419250d299 100755 --- a/compare.py +++ b/compare.py @@ -43,7 +43,7 @@ def overlay_ROC(filename, *projects, **kwargs): colors = prop_cycle.by_key()['color'] for p, color in zip(projects, colors): - fpr, tpr, threshold = roc_curve(p.y_test, p.scores_test, sample_weight = p.w_test) + fpr, tpr, threshold = roc_curve(p.l_test, p.scores_test, sample_weight = p.w_test) fpr = 1.0 - fpr try: roc_auc = auc(tpr, fpr) @@ -56,8 +56,8 @@ def overlay_ROC(filename, *projects, **kwargs): if plot_thresholds: ax2.plot(tpr, threshold, "--", color=color) if lumifactor is not None: - sumw_b = p.w_test[p.y_test==0].sum()*lumifactor - sumw_s = p.w_test[p.y_test==1].sum()*lumifactor + sumw_b = p.w_test[p.l_test==0].sum()*lumifactor + sumw_s = p.w_test[p.l_test==1].sum()*lumifactor ax_abs_b.plot(tpr, (1.-fpr)*sumw_b, alpha=0) ax_abs_b.invert_yaxis() ax_abs_s.plot(tpr*sumw_s, fpr, alpha=0)