MLOps Live

Join our webinar on Improving LLM Accuracy & Performance w/ Databricks - Tuesday 30th of April 2024 - 12 noon EST

# 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.

## What is the Formula for True Positive Rate?

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 is True Positive Rate Calculated?

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.

## AutoMLOps: Automate ML Logging and Tracking End-to-End

Automate and accelerate the deployment and management of your AI applications with the Iguazio MLOps Platform

## 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.