I know that we can use a list to indicate the order:
tn, fp, fn, tp = confusion_matrix([0, 1, 0, 1], [1, 1, 1, 0], labels=[0,1]).ravel()
but the meaning of the elements of the matrix depends on two assumptions:
- Whether rows or columns are considered as ACTUAL (or PREDICTED) labels.
- Whether
0
or1
is assumed to be the POSITIVE (or NEGATIVE) class. and none of them are directly mentioned in the docstring.
This question has been already asked here, but I think here I am asking about the root of the confusion and not the confusion in its general term. The issue is not how to interpret the confusion-matrix, but how to set a specific class as positive or negative.