-
-
Save amankharwal/1bdf31a8e89e68071f38446b7ec8a1c0 to your computer and use it in GitHub Desktop.
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
# Predictions | |
predictions = model.predict_classes(testing_images) | |
for i in range(len(predictions)): | |
if(predictions[i] >= 9): | |
predictions[i] += 1 | |
predictions[:5] | |
#Output | |
#array([ 6, 8, 11, 14, 18]) | |
# Precision, recall, f1-score for all the classes | |
from sklearn.metrics import classification_report, confusion_matrix | |
classes = ["Class " + str(i) for i in range(26) if i != 9] | |
print(classification_report(data_test['label'], predictions, target_names = classes)) | |
# Confusion Matrix for the model predictions | |
cm = confusion_matrix(data_test['label'],predictions) | |
plt.figure(figsize=(12,7)) | |
g = sns.heatmap(cm, cmap='Reds',annot=True, | |
fmt='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment