---
title: "Stop Misusing ROC Curve and GINI: Navigate Imbalanced Datasets with Confidence"
description: "ROC_AUC and the derived GINI coefficient (GINI = 2·ROC_AUC − 1) can be misleading on imbalanced binary classification problems: abundant true negatives keep the false positive rate low even when there are many false positives."
url: "https://swe.quest/articles/stop-misusing-roc-curve-and-gini-navigate-imbalanced-datasets-with-confidence-c92dc193e86fdef9"
canonical: "https://engineering.klarna.com/stop-misusing-roc-curve-and-gini-navigate-imbalanced-datasets-with-confidence-5edec4c187d7"
source: "Klarna Engineering"
published: "2023-11-09"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 10
tags: ["evals","machine-learning","payments"]
---

# Stop Misusing ROC Curve and GINI: Navigate Imbalanced Datasets with Confidence

A post on [Klarna Engineering](https://swe.quest/sources/klarna.md), published 2023-11-09, 10 min read, Deep dive. Original: [https://engineering.klarna.com/stop-misusing-roc-curve-and-gini-navigate-imbalanced-datasets-with-confidence-5edec4c187d7](https://engineering.klarna.com/stop-misusing-roc-curve-and-gini-navigate-imbalanced-datasets-with-confidence-5edec4c187d7)

## Summary

ROC\_AUC and the derived GINI coefficient (GINI = 2·ROC\_AUC − 1) can be misleading on imbalanced binary classification problems: abundant true negatives keep the false positive rate low even when there are many false positives. Precision-Recall AUC ignores true negatives and focuses on the minority class, making it the more reliable threshold-agnostic metric in that setting. In a loan-default example with a 2% default rate, two models score an identical ~49% on a simplified ROC\_AUC, yet PR\_AUC separates them at 17% vs 25%, exposing that one model wrongly flags 100 more good customers. The caveat is that PR\_AUC depends on target incidence, which makes it less intuitive for stakeholders.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Payments & fintech](https://swe.quest/tags/payments.md) (Domains)

## Prerequisites

- binary classification
- confusion matrix

## Keywords

ROC AUC, PR AUC, GINI coefficient, Precision-Recall curve, Klarna

## Related posts

- [Calibrating LLM-Based Population Estimates with Human Validation](https://swe.quest/articles/calibrating-llm-based-population-estimates-with-human-validation-c6245711febeaa73.md): Indeed Engineering · 2026-08-12 · Medium · 8 min read · Evaluation, LLMs, Machine learning
  The share of records an LLM classifies as positive is only an apparent prevalence.
- [Roonomics: How Economics Helped Us to Build a Churn Prediction Model](https://swe.quest/articles/roonomics-how-economics-helped-us-to-build-a-churn-prediction-model-fa0a6f4e34dc5a67.md): Deliveroo Engineering · 2026-09-22 · Medium · 6 min read · Machine learning, Evaluation
  Deliveroo replaced a high-recall, rule-based restaurant churn flagging system with a ranked probability model tuned for precision, because retention teams have limited capacity and false positives carry a real opportunity cost.
- [Object Detection Leaderboard](https://swe.quest/articles/object-detection-leaderboard-9807c5dfbed40ee6.md): Hugging Face · 2023-09-18 · Medium · 21 min read · Computer vision, Evaluation, Machine learning
  Object detection models on the Hugging Face Object Detection Leaderboard are ranked using IoU-based metrics, chiefly Average Precision (AP) and Average Recall (AR) with their variants.
- [Bootstrap Confidence Intervals for LLM Evaluation](https://swe.quest/articles/bootstrap-confidence-intervals-for-llm-evaluation-2cf64494cfe1e239.md): Indeed Engineering · 2026-07-08 · Hard · 31 min read · Evaluation, LLMs, Machine learning
  When LLM outputs are non-deterministic, the cluster bootstrap gives near-nominal 95% coverage with the narrowest intervals.
- [Scaling Model Evaluation at Pinterest with Ray (Part 4)](https://swe.quest/articles/scaling-model-evaluation-at-pinterest-with-ray-part-4-ba1e956bb72b960e.md): Pinterest Engineering · 2026-11-04 · Medium · 11 min read · ML platforms, Evaluation, Recommendations & ranking, Data pipelines, Python
  Pinterest fused model-evaluation metric computation into its Ray batch inference jobs, removing the separate Spark/Ray metrics job and the write-predictions-to-S3-then-reread handoff.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
