I am using Scikit-learning and I need to calculate the True positive (TP), the False Positive (FP), the True Negative (TN) and the False Negative (FN) from a confusion matrix like this:
[[2 0 3 4]
[0 4 5 1]
[1 0 3 2]
[5 0 0 4]]
I know how to calculate the TP, the FP and the FN but I don't know how to get the TN. Can someone tell me?
I think for a multiclass problem like this you have to decide which one of these 4 classes can be considered positive and you have to combine rest 3 as negative to calculate true negative.A detailed discussion was done here.
I think you should treat this multi-class classification in a one-vs-the-rest manner (so each 2x2 table
i
measures the performance of a binary classification problem that whether each obs belongs to labeli
or not). Consequently, you can calculate the TP, FP, FN, TN for each individual label.