Testing Code
jmandivarapu1 opened this issue · comments
JayaKrishna Mandivarapu commented
Hi Team,
I am not sure but could you please let me know on how to run the evaluation after running the training file. I tried to find it but couldn't find it.
I tried writing the below code but couldn't get numbers provided in the training
from src.model import *
import numpy as np
from sklearn.metrics import classification_report
discriminator = define_discriminator()
#create the generator
discriminator.load_weights('PhishGan_copy\dmodel_000200.h5')
data = np.load('phishing.npz')
#result = discriminator.evaluate(data['X_test'])
y_pred = discriminator.predict(data['X_test'], batch_size=64, verbose=1)
y_pred_bool = np.argmax(y_pred[1], axis=1)
y_test_arg=np.argmax(data['y_test'],axis=1)
print(classification_report(y_test_arg, y_pred_bool))
precision recall f1-score support
0 0.50 1.00 0.67 5000
1 1.00 0.00 0.00 5000
accuracy 0.50 10000
macro avg 0.75 0.50 0.33 10000
weighted avg 0.75 0.50 0.33 10000
Thanks
Jay