Skip to content

Commit 325a7f9

Browse files
minggliqinhanmin2014
authored andcommitted
EXA prevent example xlabel cut off in plot_confusion_matrix.py (scikit-learn#11065)
1 parent 44e33d2 commit 325a7f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/model_selection/plot_confusion_matrix.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ def plot_confusion_matrix(cm, classes,
7979
horizontalalignment="center",
8080
color="white" if cm[i, j] > thresh else "black")
8181

82-
plt.tight_layout()
8382
plt.ylabel('True label')
8483
plt.xlabel('Predicted label')
84+
plt.tight_layout()
85+
8586

8687
# Compute confusion matrix
8788
cnf_matrix = confusion_matrix(y_test, y_pred)

0 commit comments

Comments
 (0)