ium_444386/evaluation.py
szymonj98 f416349645 plot
2022-05-01 19:50:46 +02:00

26 lines
719 B
Python

import tensorflow as tf
import os
import pandas as pd
import numpy as np
import csv
from sklearn.model_selection import train_test_split
from matplotlib import pyplot as plt
x_test = pd.read_csv('xtest.csv')
y_test = pd.read_csv('ytest.csv')
model = tf.keras.models.load_model('./model')
res = model.evaluate(x_test, y_test,verbose=0)
with open('evaluation_acuraccy.txt', 'a+') as f:
f.write(str(res[1])+'\n')
with open('evaluation_acuraccy.txt') as f:
scores = [float(line) for line in f if line]
print(scores)
builds = list(range(1, len(scores) + 1))
plot = plt.plot(builds, scores)
plt.xlabel('Build')
plt.xticks(range(1, len(scores) + 1))
plt.ylabel('Accuraccy')
plt.show()