confusion matrix y_test y_pred

Viewed 255

I'm doing a classification with cnn. I find confusion_matrix to return a single value. Isn't there a problem?

from sklearn.metrics import classification_report
y_pred=model.predict(X_test) 
y_pred=np.argmax(y_pred, axis=1) 
y_test=np.argmax(y_test, axis=1)
cm = confusion_matrix(y_test, y_pred)
print(cm)

#[[851]]

I would expect something like:

#[[2 0][0 0]]

0 Answers
Related