WRITE · TRACE · UNDERSTAND
Treat tied ranking scores explicitly in ROC AUC
Implement roc_auc(labels,scores) for equal nonempty lists, binary integer labels and finite scores.
Read lesson: Treat tied ranking scores explicitly in ROC AUC →
Your experiment
Implement roc_auc(labels,scores) for equal nonempty lists, binary integer labels and finite scores. Compute exact positive-negative pair credit, half for ties. Reject single-class data.
Python runs in your browser. Your draft stays on this device.
What to look for
The quadratic reference is transparent for tiny evaluation fixtures. Large datasets should use a tie-aware rank algorithm. A high AUC can coexist with poor calibration or unacceptable errors at the chosen threshold.
Watch your code work
Ready to experimentWrite a solution or load the worked answer, then choose Trace & check.
Step through arrays, variables and training curves produced by your own Python.
