add accuracy
This commit is contained in:
parent
edfca60b98
commit
d23492d028
2
evaluate/Jenkinsfile
vendored
2
evaluate/Jenkinsfile
vendored
@ -30,7 +30,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh "chmod +x ./predict.py"
|
sh "chmod +x ./predict.py"
|
||||||
sh "python ./predict.py"
|
sh "python ./predict.py"
|
||||||
archiveArtifacts artifacts: 'predictions.txt', onlyIfSuccessful: true
|
archiveArtifacts artifacts: 'predictions.txt,accuracy.txt', onlyIfSuccessful: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from tensorflow import keras
|
from tensorflow import keras
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
from sklearn.metrics import accuracy_score
|
||||||
np.set_printoptions(threshold=np.inf)
|
np.set_printoptions(threshold=np.inf)
|
||||||
|
|
||||||
data = pd.read_csv("df_test.csv")
|
data = pd.read_csv("df_test.csv")
|
||||||
@ -13,3 +14,7 @@ predictions = model.predict(X_test)
|
|||||||
|
|
||||||
with open("predictions.txt", "w") as f:
|
with open("predictions.txt", "w") as f:
|
||||||
f.write(str(predictions))
|
f.write(str(predictions))
|
||||||
|
|
||||||
|
accuracy = accuracy_score(y_test, predictions)
|
||||||
|
with open("accuracy.txt", 'a') as file:
|
||||||
|
file.write(str(accuracy))
|
||||||
|
Loading…
Reference in New Issue
Block a user