---
title: Comparison of ROC AUC and Precision-Recall Curves for Imbalanced Data
url: https://www.dataloco.com/en/comparison-of-roc-auc-and-precision-recall-curves-for-imbalanced-data
published: 2026-09-14T12:10:34+00:00
language: en
section: Data
source: https://machinelearningmastery.com/roc-auc-vs-precision-recall-for-imbalanced-data/
publisher: Dataloco
---

# Comparison of ROC AUC and Precision-Recall Curves for Imbalanced Data

A recent discussion focused on the comparison between ROC AUC (Receiving Operating Characteristic curve and the area under it) and PR AUC (Precision-Recall AUC) in the context of imbalanced data. Imbalanced datasets are those where one class is significantly less frequent than the other, which can lead to misleading evaluations of classification performance when using traditional metrics like accuracy and ROC AUC.

The article outlines how PR curves are specifically designed to assess the performance of classifiers in scenarios where the positive class is rare. This makes them particularly useful for evaluating models trained on imbalanced datasets, as they prioritize analyzing the performance for positive class predictions. In contrast, ROC curves are less sensitive to class imbalance and may provide overly optimistic estimates of model performance.

Three practical examples were provided to illustrate the differences in performance metrics across datasets with varying levels of class imbalance. The first example used the Pima Indians Diabetes Dataset, which is slightly imbalanced, with approximately 35% of patients diagnosed with diabetes. The ROC AUC for this dataset was approximately 0.838, while the PR AUC was 0.733, indicating that the PR AUC is often lower than the ROC AUC in such cases.

The second example utilized the Wisconsin Breast Cancer dataset, where 37% of instances were positive. Here, the ROC AUC was reported as 0.9981, and the PR AUC was 0.9988, suggesting that performance metrics can vary considerably based on dataset characteristics beyond just class imbalance.

Lastly, the credit card fraud detection dataset illustrated the challenges associated with highly imbalanced data, where less than 1% of instances are labeled as fraud. In this case, the ROC AUC was recorded at 0.957, while the PR AUC was only 0.708, highlighting a significant overestimation of model performance when using the ROC curve alone. The results emphasize the importance of selecting appropriate metrics for evaluating classifiers trained on imbalanced datasets to ensure accurate assessments of their performance.
