Last active
November 22, 2020 08:40
-
-
Save naenumtou/f1ba64dd8c33fc8e1a9774bb3719721c 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
#Prediction and performance | |
from sklearn.metrics import confusion_matrix | |
pred = model.predict(Xtrain_idx).argmax(axis = 1) | |
cf_matrix = confusion_matrix(np.array(df['Categories']), pred) | |
#Plot confusion matrix | |
plt.figure(figsize = (12,8)) | |
plt.title('Confusion matrix') | |
sns.heatmap(cf_matrix, annot = True, fmt = '.0f', cmap = plt.cm.Blues) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment