Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-11T17:11:45.683Z
Answers.LastActivityDate: 2019-09-11T17:11:45.683Z
Answers.UserDisplayName: nbro
Body: <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>
  
Tags: <deep-learning><reference-request><data-science><statistical-ai>
Title: How to calculate the false positives and negatives?
UserDisplayName: user29622
ThreadText: # 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`](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.confusion_matrix.html). 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()
  
  ```
  
  
  ---
  
  