Skip to content
Snippets Groups Projects
Commit 2267c3cf authored by Nikolai Hartmann's avatar Nikolai Hartmann
Browse files

adjust compare.py

parent 9ed6b0a7
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ def overlay_ROC(filename, *projects, **kwargs): ...@@ -43,7 +43,7 @@ def overlay_ROC(filename, *projects, **kwargs):
colors = prop_cycle.by_key()['color'] colors = prop_cycle.by_key()['color']
for p, color in zip(projects, colors): 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 fpr = 1.0 - fpr
try: try:
roc_auc = auc(tpr, fpr) roc_auc = auc(tpr, fpr)
...@@ -56,8 +56,8 @@ def overlay_ROC(filename, *projects, **kwargs): ...@@ -56,8 +56,8 @@ def overlay_ROC(filename, *projects, **kwargs):
if plot_thresholds: if plot_thresholds:
ax2.plot(tpr, threshold, "--", color=color) ax2.plot(tpr, threshold, "--", color=color)
if lumifactor is not None: if lumifactor is not None:
sumw_b = p.w_test[p.y_test==0].sum()*lumifactor sumw_b = p.w_test[p.l_test==0].sum()*lumifactor
sumw_s = p.w_test[p.y_test==1].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.plot(tpr, (1.-fpr)*sumw_b, alpha=0)
ax_abs_b.invert_yaxis() ax_abs_b.invert_yaxis()
ax_abs_s.plot(tpr*sumw_s, fpr, alpha=0) ax_abs_s.plot(tpr*sumw_s, fpr, alpha=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment