Lets asumme I have the following test values:
y_test2 = [0, 0, 1, 1]
and the following prediction values:
y_pred2 = [1, 0, 1, 1]
So I have a binary classificaiton problem with {0,1}as classes. If i am using sklearn confusion_matrix:
confusion_matrix(y_test2, y_pred2)
array([[1, 1], #one 0 was predicted as 0 (TruePositive), one 0 was predicted as 1 (FalseNegative)
[0, 2]], dtype=int64) #two 1 were predicted as 1 (TrueNegatives)
So for me it is:
TP: 1
FN: 1
TN: 2
FP: 0
However, when I run the confusion_matrix with ravel, followed scikit learns documentation:
tn, fp, fn, tp = confusion_matrix(y_test2, y_pred2).ravel()
(1, 1, 0, 2)
Why is scikit interpretating the 1 as True values? And why is it not mentioned in the docs Is there any other issue I could face for binary classification with the naming convention? Is there any chance to avoid this?