liveBook · Manning

Area under the curve

As explained in Statistics Every Programmer Needs

The area under the ROC curve is a measure of a binary classifier's ability to discriminate between positive and negative classes across classification thresholds.

AUC summarizes a binary classifier’s ability to distinguish positive from negative classes across classification thresholds. Unlike accuracy, it focuses on discrimination, which can reveal weakness on an imbalanced dataset. section 5.2.4

AUC ranges from 0 to 1; values near 1 indicate strong performance. A value of 0.5 corresponds to random guessing. AUC and accuracy can differ, though they aligned for a balanced raisin-classification example. section 5.2.4

Scikit-learn evaluation

For raisin classification, roc_auc_score returned 0.8678, matching the model’s 86.78% accuracy in this balanced example. section 5.2.4

Figure 5.4 A ROC curve. The false positive rate is plotted along the x axis, and the true positive rate is plotted along the y axis. When the curve, represented by the solid line, hugs the upper-left quadrant of the plot, as it does here, it increases the area under the curve. The dashed line represents an AUC equal to 0.5, or the equivalent of random guessing.
figure

The ROC plot relates false-positive and true-positive rates; a curve nearer the upper-left corner encloses more area. section 5.2.4

How Statistics Every Programmer Needs covers it

How deep it goes
Defines AUC, interprets its range, contrasts it with accuracy, and demonstrates a scikit-learn calculation.
Examples
Uses raisin classification and an imbalanced exam-pass example to contrast AUC with accuracy.
What it assumes
Assumes binary class labels but does not state other prerequisites.
What you can do after
Apply scikit-learn’s roc_auc_score to evaluate binary-classifier discrimination.
How it connects
Connects ROC curves and classification thresholds with accuracy, class imbalance, and logistic regression.

Also explained in

Compare how 12 books explain area under the curve →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.