My problem:
I have a dataset which is a large JSON file. I read it and store it in the trainList
variable.
Next, I pre-process
You can obtain all of the parameters from the confusion matrix. The structure of the confusion matrix(which is 2X2 matrix) is as follows (assuming the first index is related to the positive label, and the rows are related to the true labels):
TP|FN
FP|TN
So
TP = cm[0][0]
FN = cm[0][1]
FP = cm[1][0]
TN = cm[1][1]
More details at https://en.wikipedia.org/wiki/Confusion_matrix