I'm following this tutorial https://youtu.be/0HDy6n3UD5M?t=1320 where he says he is calculating the false positives, but gets a numpy array of what I understand to be the 'false negatives' and 'false positives'.
E.g. confusion matrix is:
cm = confusion_matrix(y_train, y_pred, labels =[1,0])
[array([[250, 83],
[ 76, 311]])]
and he outputs the false positives as
FP = cm.sum(axis = 0) - np.diag(cm)
array([76, 83])
Shouldn't false positives just be 83? I read in another article that he might be calculating potential false positives but what does that mean? This seems to be a sum of FP and FN.
Rest of the code is:
FN = cm.sum(axis = 1) - np.diag(cm)
TP = np.diag(cm)
TN = cm.sum() - (FP + FN + TP)
TPR = TP / (TP + FN)