Skip to content
Calcrivo

ROC-AUC Calculator

Calculate the area under the ROC curve (AUC) from a list of TPR/FPR points using the trapezoidal rule.

Inputs

One point per line or separated by semicolons, each as FPR,TPR — e.g. 0,0; 0.1,0.4; ...; 1,1

ROC-AUC

0.7600

Number of Points

6

Step by step

  1. Sort points by FPR ascending

    (0, 0), (0.1, 0.4), (0.2, 0.6), (0.4, 0.8), (0.6, 0.9), (1, 1)

    = 6 points

  2. AUC: Σ trapezoid areas between consecutive points

    Σ (TPR_i + TPR_{i+1})/2 × (FPR_{i+1} − FPR_i)

    = 0.7600

How it works

The ROC curve plots true positive rate (TPR) against false positive rate (FPR) at every possible classification threshold. The area under this curve (AUC) summarizes overall discriminative ability across all thresholds in a single number: AUC = 1.0 is a perfect classifier, AUC = 0.5 is equivalent to random guessing, and AUC below 0.5 means the model is worse than random (or its predictions are inverted). This calculator numerically integrates the curve from a list of (FPR, TPR) points using the trapezoidal rule.

Formula

AUC = sum((TPR_i + TPR_{i+1}) / 2 * (FPR_{i+1} - FPR_i))

TPR_i
True positive rate at point i
FPR_i
False positive rate at point i

Frequently Asked Questions

Why does AUC = 0.5 mean random guessing?

An AUC of 0.5 corresponds to a diagonal ROC curve where TPR equals FPR at every threshold, meaning the classifier's ranking of positive vs. negative examples is no better than chance.

How many points do I need for an accurate AUC estimate?

More points give a finer approximation of the true curve; a smooth classifier evaluated at many thresholds gives near-exact AUC via the trapezoidal rule, while very few points can noticeably underestimate the true area.

Is ROC-AUC affected by class imbalance?

ROC-AUC is relatively robust to class imbalance because it's based on rates (TPR, FPR) rather than raw counts, but on highly imbalanced datasets, PR-AUC is often considered more informative since it focuses on the minority (positive) class.

You might also need