Tensorflow 이미지 분류 튜토리얼 설정을 혼란을 매트릭스

0

질문

나는 다음과 같은 이 이미지는 튜토리얼에 대한 Tensorflow지만,문제가 있을 설정하는 혼란을 매트릭스 때문에 튜토리얼을 따르지 않 X_test,y_test 는 형식으로 전통적인 예를 사용:

Ex:

from sklearn.metrics import classification_report, confusion_matrix
y_proba = model.predict(X_test) 
y_pred = np.argmax(y_proba,axis=1)
print('Confusion Matrix')
print(confusion_matrix(y_pred, y_test))
print('Classification Report')
print(classification_report(y_pred, y_test))

할 수 있는 방법 설정하는 혼란을 매트릭스에 따라 tensorflow 이미지는 튜토리얼은?

1

최고의 응답

0

@NewtoNN 나는 보았다는 튜토리얼을 제공하지만,을 찾을 수 없습니다 예측한 값입니다. 당신이 시도할 수 있습하는 첫 번째 예측하고 다음을 비교하는 진정한 값으로 예측된다.

다음 또는 이와 유사한:

from sklearn.metrics import confusion_matrix

y_proba = model.predict(val_ds)`
y_pred = np.argmax(y_proba,axis=1)`
print('Confusion Matrix')
print(confusion_matrix(y_pred, val_ds))
2021-11-24 07:18:35

안녕 마이크 때,나는 코드를 실행하면 다음과 같은 오류를 발견 입력 변수와 일치하지 않는 숫자의 samples:[480,15]'.
NewtoNN

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................