Cal11 calculator

Calculate True Negative From Confusion Matrix

Reviewed by Calculator Editorial Team

A true negative (TN) in a confusion matrix represents the number of negative cases that were correctly identified by a classification model. This metric is crucial for evaluating the performance of binary classification models, particularly in medical testing, spam detection, and other binary outcome scenarios.

What is a True Negative?

A true negative occurs when a classification model correctly predicts the negative class. For example, in a medical test:

  • True Negative: A healthy person is correctly identified as not having the disease.
  • False Positive: A healthy person is incorrectly identified as having the disease.
  • False Negative: A sick person is incorrectly identified as not having the disease.
  • True Positive: A sick person is correctly identified as having the disease.

True negatives are particularly important in scenarios where false positives could lead to unnecessary treatments or actions. A high number of true negatives indicates that the model is good at correctly identifying negative cases.

Understanding the Confusion Matrix

A confusion matrix is a table that describes the performance of a classification model. It shows the counts of:

Predicted Positive Predicted Negative
Actual Positive True Positive (TP) False Negative (FN)
Actual Negative False Positive (FP) True Negative (TN)

The true negative value is found in the bottom-right cell of the matrix. This value represents the number of negative cases that were correctly identified by the model.

How to Calculate True Negative

To calculate the true negative from a confusion matrix, follow these steps:

  1. Identify the actual negative cases in your dataset.
  2. Count how many of these actual negative cases were correctly predicted as negative by your model.
  3. This count is your true negative value.

Formula: True Negative (TN) = Number of correctly predicted negative cases

In practical terms, this means looking at the bottom-right cell of your confusion matrix and noting the value there.

Worked Example

Consider a spam detection model with the following confusion matrix:

Predicted Spam Predicted Not Spam
Actual Spam 45 5
Actual Not Spam 10 90

To find the true negative:

  1. Identify the actual not spam cases (90 + 10 = 100).
  2. Count the correctly predicted not spam cases (90).
  3. Therefore, the true negative is 90.

This means the model correctly identified 90 non-spam emails out of 100.

Frequently Asked Questions

What is the difference between true negative and true positive?
A true positive is when the model correctly identifies a positive case, while a true negative is when it correctly identifies a negative case. Both are important but serve different purposes in evaluating model performance.
Why is true negative important in medical testing?
In medical testing, a high true negative rate means fewer healthy patients are incorrectly diagnosed with a disease, reducing unnecessary treatments and patient anxiety.
How can I improve my model's true negative rate?
Improving the true negative rate often involves better feature selection, more training data, or adjusting classification thresholds to reduce false positives.