From a5e854c1ebb3398e893964a29ffc84c0532f86a1 Mon Sep 17 00:00:00 2001 From: Agata Date: Fri, 29 Apr 2022 22:51:30 +0200 Subject: [PATCH] Save atrifacts --- evaluation.Jenkinsfile | 2 +- evaluation.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/evaluation.Jenkinsfile b/evaluation.Jenkinsfile index 5547d70..f88ece2 100644 --- a/evaluation.Jenkinsfile +++ b/evaluation.Jenkinsfile @@ -21,7 +21,7 @@ pipeline { copyArtifacts filter: '*', projectName:'s444421-training/training_and_evaluation', selector: buildParameter('BUILD_SELECTOR') copyArtifacts filter: '*', projectName:'s444421-evaluation/training_and_evaluation', optional: true sh 'ipython ./evaluation.py' - archiveArtifacts artifacts: 'build_accuracy.txt' + archiveArtifacts artifacts: 'build_accuracy.txt, bilds_accuracy.jpg' } } } diff --git a/evaluation.py b/evaluation.py index 4c43c1e..e5be79d 100644 --- a/evaluation.py +++ b/evaluation.py @@ -10,6 +10,7 @@ from sklearn.metrics import accuracy_score import torch from torch import nn, optim import torch.nn.functional as F +import matplotlib.pyplot as plt # In[ ]: @@ -71,3 +72,18 @@ with open('build_accuracy.txt', 'a') as file: file.write(str(accuracy)) file.write('\n') + +# In[ ]: + + +with open('build_accuracy.txt') as file: + acc = [float(line.rstrip()) for line in file] + +builds = list(range(1, len(acc) + 1)) + +plt.xlabel('build') +plt.ylabel('accuracy') +plt.plot(builds, acc, 'ro') +plt.show() +plt.savefig('bilds_accuracy.jpg') +