created evaluation
This commit is contained in:
parent
5d6b0d03d4
commit
ba3dcfa9b0
0
Jenkinsfile_evaluation
Normal file
0
Jenkinsfile_evaluation
Normal file
@ -26,7 +26,7 @@ pipeline {
|
|||||||
|
|
||||||
stage('archiveArtifacts') {
|
stage('archiveArtifacts') {
|
||||||
steps {
|
steps {
|
||||||
archiveArtifacts 'model/saved_model.pb'
|
archiveArtifacts 'model'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
evaluation.png
Normal file
BIN
evaluation.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
50
evaluation.py
Normal file
50
evaluation.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import numpy as np
|
||||||
|
from tensorflow import keras
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from sklearn.metrics import accuracy_score, f1_score
|
||||||
|
|
||||||
|
|
||||||
|
learned_model = 'model'
|
||||||
|
model = keras.models.load_model(learned_model)
|
||||||
|
|
||||||
|
train=pd.read_csv('train.csv', header=None, skiprows=1)
|
||||||
|
indexNames = train[train[1] ==2].index
|
||||||
|
train.drop(indexNames, inplace=True)
|
||||||
|
cols=[0,2,3]
|
||||||
|
X=train[cols].to_numpy()
|
||||||
|
y=train[1].to_numpy()
|
||||||
|
X=np.asarray(X).astype('float32')
|
||||||
|
|
||||||
|
test=pd.read_csv('test.csv', header=None, skiprows=1)
|
||||||
|
cols=[0,2,3]
|
||||||
|
indexNames = test[test[1] ==2].index
|
||||||
|
test.drop(indexNames, inplace=True)
|
||||||
|
X_test=test[cols].to_numpy()
|
||||||
|
y_test=test[1].to_numpy()
|
||||||
|
X_test=np.asarray(X_test).astype('float32')
|
||||||
|
|
||||||
|
predictions = model.predict(X_test)
|
||||||
|
|
||||||
|
|
||||||
|
acc = accuracy_score(y_test, predictions)
|
||||||
|
print('Accuracy: ', acc)
|
||||||
|
|
||||||
|
f1=f1_score(y_test, predictions)
|
||||||
|
print('F1: ', f1)
|
||||||
|
|
||||||
|
with open('evaluation.txt', 'a') as f:
|
||||||
|
f.write(str(acc) + "\n")
|
||||||
|
|
||||||
|
with open('evaluation.txt', 'r') as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
|
||||||
|
|
||||||
|
fig = plt.figure(figsize=(5,5))
|
||||||
|
chart = fig.add_subplot()
|
||||||
|
chart.set_ylabel("Accuracy")
|
||||||
|
chart.set_xlabel("Build")
|
||||||
|
x = np.arange(0, len(lines), 1)
|
||||||
|
y = [float(x) for x in lines]
|
||||||
|
plt.plot(x, y, "go")
|
||||||
|
plt.savefig("evaluation.png")
|
3
evaluation.txt
Normal file
3
evaluation.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
0.5406397482957525
|
||||||
|
0.5406397482957525
|
||||||
|
0.5406397482957525
|
Loading…
Reference in New Issue
Block a user