Sensitivity vs. Specificity: What’s the Difference?

# Sensitivity vs. Specificity: What’s the Difference?

Vikram Singh
Assistant Manager - Content
Updated on Oct 13, 2023 15:30 IST

Sensitivity and Specificity are often used interchangeably, but they are two different concepts. Sensitivity refers to the ability of a test to identify those with the disease correctly. In contrast, Specificity refers to the ability of a test to identify those without the disease correctly. Both measures are important in determining the accuracy of a diagnostic test. In this article, we will discuss the difference between Sensitivity and Specificity.

Sensitivity and Specificity are similar to precision and recall, which evaluate the model performance. In the data science community, while evaluating the model performance, precision and recall are mainly used, but in the medical world, Sensitivity and Specificity are used to evaluate the medical test. In medical terms, Sensitivity indicates the ability to detect the disease, while Specificity refers to the percentage of people who don’t actually have the disease are tested negative. This article will briefly discuss Sensitivity vs. Specificity in full detail.

This article will use the confusion matrix’s True Positive, True Negative, False Positive, and False negative. So before proceeding further:

Must Check: Confusion Matrix

Must Check: Type-1 vs. Type-2 Error

## Sensitivity

Definition

Sensitivity measures how well a machine learning model can detect positive instances. In other words, it measures how likely you will get a positive result when you test for something.

• It is also known as a True Positive Rate or Recall.
• The model with high Sensitivity will have significantly fewer False Negatives.
• The higher the Sensitivity better the model.

Formula

Sensitivity = True Positive (TP) / True Positive (TP) + False Negative (FN)

Example

For example, let’s say you’re testing for a disease. A high sensitivity means that the test is very likely to detect the disease if it’s present. Low Sensitivity means the test is less likely to detect the disease if it’s present. So that’s what Sensitivity is all about—detecting the presence of something.

Difference Between Type 1 and Type 2 Error
Type – 1 error is known as false positive, i.e., when we reject the correct null hypothesis, whereas type -2 error is also known as a false negative, i.e., when...read more
Difference between Accuracy and Precision
Precision refers to the closeness of multiple reading of the same quantity, whereas accuracy refers to the measured value to the true value. In this article we will discuss difference...read more
Standard Error vs. Standard Deviation
Standard Error quantifies the variability between sample drawn from the same population, whereas the standard deviation quantifies the variability of values in a dataset. In this article we will discuss...read more

## Specificity

Definition

Specificity measures the proportion of True Negative which are correctly identified by the model.

• It is also called a True Negative Rate (TNR).
• The Sum of the True Negative Rate and False Negative Rate is 1.
• The higher Specificity of the model indicates that the model correctly identifies most of the negative results.
• A lower specificity value indicates the model misled the negative results as positive.
• In Medical terms, Specificity is a measure of the proportion of people not suffering from the disease who got predicted correctly as those not suffering from the disease.

Formula

Specificity = True Negative (TN) / True Negative (TN) + False Positive (FP)

Example

A blood test that screens for all possible infections will be less specific than a blood test that screens for just one type of infection.

## Key Differences and Similarities between Sensitivity and Specificity

• Sensitivity is affected by the prevalence of the positive class, whereas Specificity is affected by the prevalence of the negative class.
• Compared to Specificity, Sensitivity is more likely to be affected by imbalanced data.
• Sensitivity and Specificity are inversely related, i.e., when sensitivity increases, specificity decreases and vice versa.