Skip to content

Instantly share code, notes, and snippets.

@kedisho
Created December 14, 2022 16:31
Show Gist options
  • Save kedisho/48e952222a4a6a3506a783636e7dd746 to your computer and use it in GitHub Desktop.
Save kedisho/48e952222a4a6a3506a783636e7dd746 to your computer and use it in GitHub Desktop.
from sklearn.metrics import accuracy_score, f1_score, precision_score, recall_score, classification_report, confusion_matrix
skplt.metrics.plot_confusion_matrix(y_true, y_pred, figsize=(12,12), x_tick_rotation=90)
print('f1_score:', f1_score(y_true, y_pred, average="macro"))
print('precision_score:', precision_score(y_true, y_pred, average="macro"))
print('recall_score:', recall_score(y_true, y_pred, average="macro"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment