반응형
argmax()
최대값의 인덱스를 알려주는 argmax () 함수
from sklearn.metrics import confusion_matrix
y_pred = model.predict(test_images)
y_pred = y_pred.argmax( axis = 1 )
y_pred

test_labels

cm = confusion_matrix(test_labels, y_pred)
cm

import seaborn as sb
sb.heatmap(cm, annot=True, fmt='.0f', cmap= 'RdPu')
plt.show()

반응형
'Deep Learning > Tensorflow' 카테고리의 다른 글
| Tensorflow - callback class를 이용해서, 원하는 조건이 되면 학습을 멈추게 하는 코드 (0) | 2022.06.13 |
|---|---|
| Tensorflow - overfitting & underfitting (0) | 2022.06.13 |
| Tensorflow - 분류의 문제에서 loss 셋팅하는 방법 (0) | 2022.06.13 |
| Tensorflow - activation function [ softmax ] (0) | 2022.06.13 |
| Tensorflow - Flatten Library (0) | 2022.06.13 |