Compare commits
2 Commits
e6d4c07a7a
...
520206ef22
Author | SHA1 | Date | |
---|---|---|---|
|
520206ef22 | ||
|
65bf01c425 |
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
@ -17,6 +17,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464914-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
||||||
copyArtifacts filter: '*', projectName: 's464914-training/experiments/', selector: buildParameter('BUILD_SELECTOR')
|
copyArtifacts filter: '*', projectName: 's464914-training/experiments/', selector: buildParameter('BUILD_SELECTOR')
|
||||||
|
copyArtifacts filter: '*', projectName: 's464914-evaluation/evaluation/', selector: buildParameter('BUILD_SELECTOR'), optional: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Prediction') {
|
stage('Prediction') {
|
||||||
@ -41,5 +42,17 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stage('Plot Accuracy') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def customImage = docker.build("custom-image")
|
||||||
|
customImage.inside {
|
||||||
|
sh 'python3 ./plot.py'
|
||||||
|
archiveArtifacts artifacts: 'accuracy.png', onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -18,8 +18,7 @@ rmse = np.sqrt(mean_squared_error(true_labels, predicted_labels))
|
|||||||
|
|
||||||
with open(r'metrics.txt', 'a') as fp:
|
with open(r'metrics.txt', 'a') as fp:
|
||||||
fp.write(f"Accuracy: {accuracy}\n")
|
fp.write(f"Accuracy: {accuracy}\n")
|
||||||
fp.write(f"Micro-average Precision: {precision_micro}\n")
|
fp.write(f"Precision: {precision_micro}\n")
|
||||||
fp.write(f"Micro-average Recall: {recall_micro}\n")
|
fp.write(f"Recall: {recall_micro}\n")
|
||||||
fp.write(f"Micro-average F1-score: {f1_micro}\n")
|
fp.write(f"F1-score: {f1_micro}\n")
|
||||||
fp.write(f"RMSE: {rmse}\n")
|
fp.write(f"RMSE: {rmse}\n")
|
||||||
fp.write("--------------------\n")
|
|
21
plot.py
Normal file
21
plot.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
accuracy = []
|
||||||
|
|
||||||
|
f = open("metrics.txt", "r")
|
||||||
|
for line in f:
|
||||||
|
parts = line.strip().split(' ')
|
||||||
|
if(parts[0] == 'Accuracy:'):
|
||||||
|
accuracy.append(float(parts[1]))
|
||||||
|
|
||||||
|
y_values = np.arange(1, len(accuracy) + 1)
|
||||||
|
|
||||||
|
plt.plot(y_values, accuracy, marker='o', linestyle='-', color='b')
|
||||||
|
plt.xlabel('Build Number')
|
||||||
|
plt.ylabel('Accuracy')
|
||||||
|
plt.title('Accuracy Plot')
|
||||||
|
plt.grid(True)
|
||||||
|
plt.show()
|
||||||
|
|
||||||
|
plt.savefig('accuracy.png')
|
Loading…
Reference in New Issue
Block a user