ROC / AUC

Compute ROC points and AUC from binary scores.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter one line per example as label,score where the label is 0 or 1 and the score is the model's predicted probability. You get the AUC, the area under the ROC curve, with the number of positives and negatives. 1.0 is perfect ranking and 0.5 is chance.

How to use

1
Step 1
Enter lines as label,score, for example 1,0.9.
2
Step 2
Press Calculate.
3
Step 3
Read the AUC.

How it works

Examples are ranked by score. Sweeping the threshold from high to low traces the ROC curve of true-positive rate against false-positive rate, and the AUC is the trapezoidal area under it. It equals the probability that a random positive scores above a random negative.

AUC = ∫ TPR d(FPR) via trapezoids on ranked scores

Worked example

Four predictions

Input
0,0.1 0,0.4 1,0.35 1,0.9
Output
AUC 0.75; positives 2; negatives 2
Walkthrough
Of the four positive-negative pairs, three are ranked correctly (0.9 beats both negatives, 0.35 beats 0.1) and one is not (0.35 is below 0.4), so 3/4 = 0.75.

Limitations

  • Binary classification only.
  • The ROC points and curve are not displayed, only the AUC and counts.
  • Needs at least one positive and one negative example.

Questions

How do I calculate AUC?
Enter label,score lines and press Calculate.
What is a good AUC?
0.5 is random, 0.7 to 0.8 is acceptable, above 0.9 is excellent, though it depends on the problem.
Does AUC depend on the threshold?
No, it summarises ranking across all thresholds.
What does an AUC of 0.75 mean?
A randomly chosen positive example outscores a randomly chosen negative one 75% of the time.

Features

  • Trapezoidal AUC
  • Counts positives and negatives
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Machine Learning for Everybody

    freeCodeCamp.org

    Accessible ML survey for AI calculator and metric tools.

    Watch on YouTube
  • Vectors | Essence of linear algebra

    3Blue1Brown

    Embeddings and vectors start with linear algebra intuition.

    Watch on YouTube