ium_z444439/predictions.py
2023-05-11 18:32:15 +02:00

20 lines
399 B
Python

import keras
import numpy as np
import tensorflow as tf
import pandas as pd
data = tf.keras.models.load_model('model')
x_to_test = pd.read_csv('./X_test.csv')
y_to_test = pd.read_csv('./Y_test.csv')
accu = data.evaluate(x_to_test, y_to_test)
with open('metrics.csv', 'a') as file:
file.write(f'1,{accu}\n')
pre = data.predict(x_to_test)
pre.tofile('prediction.csv', sep=',', format='%s')