Evaluate an imbalanced classifier beyond accuracy

8 steps · about 4 h 5 min · Intermediate

  1. Choose metrics from the decision goal (guide, scikit-learn developers, 40 min)

    Accuracy can look strong while a rare but important class is almost always missed.

  2. Count each kind of classification result (reference, scikit-learn developers, 20 min)

    The confusion matrix connects abstract metrics to concrete false positives and false negatives.

  3. Trace precision-recall tradeoffs (reference, scikit-learn developers, 25 min)

    A curve shows how changing the threshold shifts performance on the positive class.

  4. Plot average precision and the curve (guide, scikit-learn developers, 35 min)

    Build the visual evaluation and relate its area to ranked predictions.

  5. Check whether probabilities mean what they say (guide, scikit-learn developers, 35 min)

    Threshold decisions are more defensible when predicted probabilities are calibrated.

  6. Compare reliability curves (guide, scikit-learn developers, 35 min)

    Visualise overconfidence and underconfidence across probability ranges.

  7. Tune the decision threshold separately (guide, scikit-learn developers, 30 min)

    Probability estimation and the action cutoff are two different choices.

  8. Preserve class representation in validation (guide, scikit-learn developers, 25 min)

    Stratification reduces fold failures while still requiring honest reporting of uncertainty.