Last active
December 5, 2020 23:21
-
-
Save bpatra/fd302a09afdb54c57b95a3908059cf62 to your computer and use it in GitHub Desktop.
confusionreport.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics import classification_report, confusion_matrix | |
TEST_SIZE=200 | |
target_names = ['J', 'L'] | |
Y_pred = model_convenet_ad_hoc.predict_generator(test_generator, TEST_SIZE) | |
Y_pred = Y_pred.flatten() | |
y_pred_class = np.where(Y_pred > 0.5, 1, 0) | |
print('Classification Report') | |
print(classification_report(test_generator.classes, y_pred_class, target_names=target_names)) | |
print('Confusion Matrix') | |
plot_confusion_matrix(confusion_matrix(test_generator.classes, y_pred_class),target_names) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment