1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
2018-05-24 01:42:51 +10:00

19 lines
463 B
Python

import numpy as np
from keras.models import Model
from keras.utils import to_categorical
pred_y = np.load("predicted_results.npy")
test_y = np.load("Waldo_test_lbl.npy")
test_y = to_categorical(test_y)
f = open("test_output.txt", 'w')
z = 0
for i in range(0, len(test_y)):
print(pred_y[i], test_y[i], file=f)
# Calculates correct predictions
if pred_y[i][0] == test_y[i][0]:
z+=1
print("Accuracy: {}%".format(z/len(test_y)*100))
f.close()