21 lines
529 B
Python
21 lines
529 B
Python
![]() |
import os
|
||
|
import tensorflow as tf
|
||
|
import pandas as pd
|
||
|
from keras import utils
|
||
|
|
||
|
build_number = int(os.environ['BUILD_NUMBER'])
|
||
|
model = tf.keras.models.load_model('model')
|
||
|
|
||
|
x_to_test = pd.read_csv('./X_test.csv')
|
||
|
y_to_test = pd.read_csv('./Y_test.csv')
|
||
|
|
||
|
y_to_test = utils.to_categorical(y_to_test)
|
||
|
|
||
|
metrics = model.evaluate(x_to_test, y_to_test)
|
||
|
|
||
|
with open('metrics.csv', 'a') as file:
|
||
|
file.write(f'{build_number},{metrics}\n')
|
||
|
|
||
|
predictions = model.predict(x_to_test)
|
||
|
|
||
|
predictions.tofile('prediction.csv', sep=',', format='%s')
|