Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created October 8, 2020 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/4791a6719e0674af9a14dff946534ccf to your computer and use it in GitHub Desktop.
Save amankharwal/4791a6719e0674af9a14dff946534ccf to your computer and use it in GitHub Desktop.
labels = [‘English’, ‘Afrikaans’, ‘Nederlands’]
# Confusion Matrix
cm_Model_dt = confusion_matrix(y_test, y_pred, labels)
fig = plt.figure(figsize=(9,9))
ax = fig.add_subplot(111)
sns.heatmap(cm_Model_dt, annot=True, fmt=".3f", linewidths=.5, square = True, cmap = 'Blues_r')
plt.ylabel('Actual')
plt.xlabel('Predicted')
ax.set_xticklabels(labels)
ax.set_yticklabels(labels)
title = 'Decision Tree Model Accuracy Score = '+ str(round(accuracy_score_dt*100,2)) +"%"
plt.title(title, size = 15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment