removed evaluation in train.py

This commit is contained in:
Anna Nowak 2021-04-30 00:07:34 +02:00
parent 837e1aebc0
commit 54bf45f0f6
4 changed files with 22 additions and 3374 deletions

View File

@ -1,6 +1,6 @@
pipeline { pipeline {
agent { agent {
docker { image 'adnovac/ium_s434760:1.1' } docker { image 'adnovac/ium_s434760:1.2' }
} }
parameters{ parameters{
buildSelector( buildSelector(
@ -29,7 +29,7 @@ pipeline {
copyArtifacts(fingerprintArtifacts: true, optional: true, projectName: 's434760-evaluation', selector: buildParameter('WHICH_BUILD_THIS')) copyArtifacts(fingerprintArtifacts: true, optional: true, projectName: 's434760-evaluation', selector: buildParameter('WHICH_BUILD_THIS'))
} }
} }
stage('train') stage('evaluate')
{ {
steps steps
{ {
@ -46,7 +46,7 @@ pipeline {
stage('send email') { stage('send email') {
steps { steps {
emailext body: currentBuild.result ?: 'SUCCESS', emailext body: currentBuild.result ?: 'SUCCESS',
subject: 's434760 - validation', subject: 's434760 - evaluation',
to: 'annnow19@st.amu.edu.pl' to: 'annnow19@st.amu.edu.pl'
} }
} }

View File

@ -1,6 +1,6 @@
pipeline { pipeline {
agent { agent {
docker { image 'adnovac/ium_s434760:1.0' } docker { image 'adnovac/ium_s434760:1.2' }
} }
parameters{ parameters{
buildSelector( buildSelector(

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,6 @@ X=train_data[input_columns].to_numpy()
Y=train_data[["Overall"]].to_numpy() Y=train_data[["Overall"]].to_numpy()
model = None model = None
if path.exists(model_name):
model = keras.models.load_model(model_name)
else:
model = keras.Sequential(name="fifa_overall") model = keras.Sequential(name="fifa_overall")
model.add(keras.Input(shape=(len(input_columns),), name="player_info")) model.add(keras.Input(shape=(len(input_columns),), name="player_info"))
model.add(layers.Dense(4, activation="relu", name="layer1")) model.add(layers.Dense(4, activation="relu", name="layer1"))
@ -36,22 +33,3 @@ else:
) )
model.save(model_name) model.save(model_name)
test_data=pd.read_csv('test.csv')
X_test=test_data[input_columns].to_numpy()
Y_test=test_data[["Overall"]].to_numpy()
results_train = model.evaluate(X, Y, batch_size=128)
results_test = model.evaluate(X_test, Y_test, batch_size=128)
y_pred = model(X_test)
lines = ["Name;Overall;Predicted overall\n"]
for i in range(len(X_test)):
name = test_data["Name"][i]
lines.append(f"{name};{int(Y_test[i])};{int(y_pred[i])}\n")
with open('results.csv', 'w+', encoding="UTF-8") as f:
f.writelines(lines)
with open('evaluation_result.txt', 'w+', encoding="UTF-8") as f:
f.write(f"Train: {str(results_train)}\nTest: {str(results_test)}")