Meet Us at ODSC West in San Francisco from Oct 31-Nov 1

What is the True Positive Rate in Machine Learning?

The true positive rate (TPR) is a measure used in statistics, machine learning, and medical diagnostics to evaluate the performance of a binary classification model. It represents the proportion of actual positive cases that were correctly identified or classified as positive by the model. TPR is also known as sensitivity, recall, or hit rate.

True Positive Rate can be used to measure binary context problems. For example, predicting events, detecting diseases, quality control and ML – to evaluate the performance of classification algorithms or models. 

True Positive Rate Formula

TPR Rate measures the proportion of positive instances that are accurately detected as positive by the model. It is calculated as:

TPR = TP / (TP + FN)

  • TP (True Positive) – The positive instances correctly classified.
  • FN (False Negative) – The negative instances incorrectly classified.

How to Calculate the TPR

Here’s a step-by-step guide to calculating the true positive rate:

  1. Gather the required data. Find the number of true positives (TP) and false negatives (FN) from your classification model’s results.
  2. Calculate the sum of TP and FN.
  3. Divide TP by the sum calculated in the previous step.
  4. To express the true positive rate as a percentage, multiply by 100.

True Positive Rate vs. False Positive Rate

The true positive rate (TPR) and false positive rate (FPR) are two important performance metrics used in binary classification problems to evaluate the effectiveness of a model.

If TPR measures the positive instances, FPR measures the proportion of negative instances that are incorrectly classified as positive by the model. 

FPR is calculated as:

FPR = FP / (FP + TN)

  • FP (False Positive) – The positive instances that were incorrectly classified.
  • TN (True Negative) – The negative instances that were correctly classified.

An easier way to represent this is with a table:

True Positive Rate and Machine Learning

True positive rate (TPR) is a performance metric used to evaluate the effectiveness of binary classification models in machine learning. In this case, it represents the proportion of positive instances that were correctly predicted as positive by the model.