I have a huge amount of data and I want to calculate my false positive and false negative. Is there a software that can help me determine it?


1 Answer 1


Yes, you can use sklearn's confusion_matrix. To explicitly extract the false positives and negatives, you can do

from sklearn.metrics import confusion_matrix

y_true = [0, 1, 0, 1]
y_pred = [1, 1, 1, 0]
tn, fp, fn, tp = confusion_matrix(y_true, y_pred).ravel()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .