ium_z444439/predictions.py

21 lines
430 B
Python
Raw Normal View History

2023-05-11 19:00:42 +02:00
import os
2023-05-11 18:11:43 +02:00
import tensorflow as tf
2023-05-10 22:50:54 +02:00
import pandas as pd
2023-05-11 19:00:42 +02:00
build_no = int(os.environ['BUILD_NUMBER'])
2023-05-11 18:32:15 +02:00
data = tf.keras.models.load_model('model')
2023-05-10 22:50:54 +02:00
2023-05-11 18:32:15 +02:00
x_to_test = pd.read_csv('./X_test.csv')
y_to_test = pd.read_csv('./Y_test.csv')
2023-05-10 22:50:54 +02:00
2023-05-11 18:32:15 +02:00
accu = data.evaluate(x_to_test, y_to_test)
2023-05-10 22:50:54 +02:00
2023-05-11 18:32:15 +02:00
with open('metrics.csv', 'a') as file:
2023-05-11 19:00:42 +02:00
file.write(f'{build_no},{accu}\n')
2023-05-11 18:32:15 +02:00
pre = data.predict(x_to_test)
pre.tofile('prediction.csv', sep=',', format='%s')