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

xlim and ylim for overlay_ROC

parent 99f3359d
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,12 @@ from .toolkit import ClassificationProject
A few functions to compare different setups
"""
def overlay_ROC(filename, *projects):
def overlay_ROC(filename, *projects, **kwargs):
xlim = kwargs.pop("xlim", (0,1))
ylim = kwargs.pop("ylim", (0,1))
if kwargs:
raise KeyError("Unknown kwargs: {}".format(kwargs))
logger.info("Overlay ROC curves for {}".format([p.name for p in projects]))
......@@ -25,15 +30,16 @@ def overlay_ROC(filename, *projects):
plt.grid(color='gray', linestyle='--', linewidth=1)
plt.plot(tpr, fpr, label=str(p.name+" (AUC = {})".format(roc_auc)))
plt.xlim(0,1)
plt.ylim(0,1)
plt.xticks(np.arange(0,1,0.1))
plt.yticks(np.arange(0,1,0.1))
if xlim is not None:
plt.xlim(*xlim)
if ylim is not None:
plt.ylim(*ylim)
# plt.xticks(np.arange(0,1,0.1))
# plt.yticks(np.arange(0,1,0.1))
plt.legend(loc='lower left', framealpha=1.0)
plt.title('Receiver operating characteristic')
plt.ylabel("Background rejection")
plt.xlabel("Signal efficiency")
plt.plot([0,1],[1,0], linestyle='--', color='black', label='Luck')
plt.savefig(filename)
plt.clf()
......
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