removed evaluation in train.py
This commit is contained in:
parent
837e1aebc0
commit
54bf45f0f6
@ -1,6 +1,6 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker { image 'adnovac/ium_s434760:1.1' }
|
||||
docker { image 'adnovac/ium_s434760:1.2' }
|
||||
}
|
||||
parameters{
|
||||
buildSelector(
|
||||
@ -29,7 +29,7 @@ pipeline {
|
||||
copyArtifacts(fingerprintArtifacts: true, optional: true, projectName: 's434760-evaluation', selector: buildParameter('WHICH_BUILD_THIS'))
|
||||
}
|
||||
}
|
||||
stage('train')
|
||||
stage('evaluate')
|
||||
{
|
||||
steps
|
||||
{
|
||||
@ -46,7 +46,7 @@ pipeline {
|
||||
stage('send email') {
|
||||
steps {
|
||||
emailext body: currentBuild.result ?: 'SUCCESS',
|
||||
subject: 's434760 - validation',
|
||||
subject: 's434760 - evaluation',
|
||||
to: 'annnow19@st.amu.edu.pl'
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker { image 'adnovac/ium_s434760:1.0' }
|
||||
docker { image 'adnovac/ium_s434760:1.2' }
|
||||
}
|
||||
parameters{
|
||||
buildSelector(
|
||||
|
3330
results.csv
3330
results.csv
File diff suppressed because it is too large
Load Diff
22
train.py
22
train.py
@ -12,9 +12,6 @@ X=train_data[input_columns].to_numpy()
|
||||
Y=train_data[["Overall"]].to_numpy()
|
||||
model = None
|
||||
|
||||
if path.exists(model_name):
|
||||
model = keras.models.load_model(model_name)
|
||||
else:
|
||||
model = keras.Sequential(name="fifa_overall")
|
||||
model.add(keras.Input(shape=(len(input_columns),), name="player_info"))
|
||||
model.add(layers.Dense(4, activation="relu", name="layer1"))
|
||||
@ -36,22 +33,3 @@ else:
|
||||
)
|
||||
|
||||
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)}")
|
Loading…
Reference in New Issue
Block a user