<p>Yes, you can use <code>sklearn</code>'s <a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html" rel="nofollow noreferrer"><code>confusion_matrix</code></a>. To explicitly extract the false positives and negatives, you can do</p>

<pre><code>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()
</code></pre>

CC BY-SA 4.0
2019-09-11T17:11:45.683Z
2019-09-11T17:11:45.683Z
nbro
<p>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?</p>

<deep-learning><reference-request><data-science><statistical-ai>
How to calculate the false positives and negatives?
user29622
# How to calculate the false positives and negatives?

(Asked by: username_0 on 2019-09-11)

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?

**Tags:** deep-learning, reference-request, data-science, statistical-ai


---

## 1 answers

### Answer by username_1 on 2019-09-11. Score: 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()


---

