Same AUC, two algorithms

Step 0 / 8
Method A — threshold sweep (the textbook / sklearn algorithm)
FPR (1 − specificity) TPR (sensitivity) 0 1 0 1
cum. TP
0
cum. FP
0
TPR
0.00
FPR
0.00
Method B — pairwise comparison (the intuitive one)
positive ranked above negative
positive ranked below negative
concordant
0
discordant
0
pairs seen
0 / 16
Press Next or drag the slider to sweep the threshold down through the eight scores.
What's happening at each step

Both panels are driven by the same single pass through the scores, sorted highest to lowest. Method A does what your ROC library actually does: lower the threshold past each unique score, and after every negative label it plots a new point at (cumulative FPR, cumulative TPR) — that's the staircase.

Method B is the "compare every positive/negative pair" definition. It never runs explicitly in the ROC code, but it's happening implicitly: the moment the sweep passes a negative example, every positive already counted above it is a pair the positive correctly outranked. That's exactly one row of green cells lighting up.

Run to the end and check the two AUC numbers below the panels — concordant ÷ 16 from the grid and the shaded trapezoid area from the curve land on the identical value, because they are the identical computation, just told two different ways.