From e827fe9ce4b5e1d994d30ad16f133e9f8ac7016b Mon Sep 17 00:00:00 2001 From: Thomas Weber <Thomas.Weber@physik.uni-muenchen.de> Date: Fri, 27 Apr 2018 18:11:43 +0200 Subject: [PATCH] Write auc in ROC plot --- toolkit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolkit.py b/toolkit.py index 2ddb7a3..4fce688 100755 --- a/toolkit.py +++ b/toolkit.py @@ -419,7 +419,7 @@ class KerasROOTClassification: 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.text(0.21,0.02,"AUC: {}".format(str(roc_auc)), size=12) plt.savefig(os.path.join(self.project_dir, "ROC.pdf")) plt.clf() @@ -436,6 +436,7 @@ class KerasROOTClassification: plt.xlabel('epoch') plt.legend(['train','test'], loc='upper left') plt.savefig(os.path.join(self.project_dir, "losses.pdf")) + plt.clf() def plot_accuracy(self): @@ -448,6 +449,7 @@ class KerasROOTClassification: plt.xlabel('epoch') plt.legend(['train', 'test'], loc='upper left') plt.savefig(os.path.join(self.project_dir, "accuracy.pdf")) + plt.clf() if __name__ == "__main__": -- GitLab