This commit is contained in:
parent
7e36de3d17
commit
574f34d3b1
4
evaluate/Jenkinsfile
vendored
4
evaluate/Jenkinsfile
vendored
@ -17,7 +17,7 @@ pipeline {
|
||||
steps {
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 'z-s464980-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's464980-training/master', selector: buildParameter('BUILD_SELECTOR')
|
||||
copyArtifacts fingerprintArtifacts: true, projectName: 's464980-evaluation/master', selector: buildParameter('BUILD_SELECTOR'), optional: true
|
||||
// copyArtifacts fingerprintArtifacts: true, projectName: 's464980-evaluation/master', selector: buildParameter('BUILD_SELECTOR'), optional: true
|
||||
}
|
||||
}
|
||||
stage("Prediction") {
|
||||
@ -31,7 +31,7 @@ pipeline {
|
||||
steps {
|
||||
sh "chmod +x ./predict.py"
|
||||
sh "python ./predict.py"
|
||||
archiveArtifacts artifacts: 'predictions.txt,accuracy.txt', onlyIfSuccessful: true
|
||||
archiveArtifacts artifacts: 'predictions.txt,accuracy.txt,rmse.jpg', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
15
predict.py
15
predict.py
@ -2,6 +2,8 @@ import pandas as pd
|
||||
from tensorflow import keras
|
||||
import numpy as np
|
||||
from sklearn.metrics import root_mean_squared_error
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
np.set_printoptions(threshold=np.inf)
|
||||
|
||||
data = pd.read_csv("df_test.csv")
|
||||
@ -17,4 +19,15 @@ with open("predictions.txt", "w") as f:
|
||||
|
||||
accuracy = root_mean_squared_error(y_test, predictions)
|
||||
with open("rmse.txt", 'a') as file:
|
||||
file.write(str(accuracy))
|
||||
file.write(str(accuracy)+"\n")
|
||||
|
||||
with open("rmse.txt", 'r') as file:
|
||||
lines = file.readlines()
|
||||
num_lines = len(lines)
|
||||
lines = [float(line.replace("\n", "")) for line in lines]
|
||||
|
||||
plt.plot(range(1, num_lines+1), lines)
|
||||
plt.xlabel("Build number")
|
||||
plt.ylabel("RMSE value")
|
||||
plt.title("RMSE")
|
||||
plt.savefig("rmse.jpg")
|
||||
|
@ -2,3 +2,4 @@ pandas
|
||||
scikit-learn
|
||||
tensorflow
|
||||
numpy
|
||||
matplotlib
|
Loading…
Reference in New Issue
Block a user