Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Auditing a classifier with subgroup discovery

A classifier can have good overall performance and poor performance within a describable population. SubROC searches for exceptional ranking performance using labels and prediction scores Siegl et al., 2025.

Train once, then search separate rows

We fit a simple model on part of scikit-learn’s breast-cancer dataset and audit its scores on different rows. Only six measurements are used as descriptors to keep the demonstration small.

Loading...

positive_value defines which label the score ranks upward. Check its meaning: the loader encodes benign as 1. Reversing the score-label pairing would reverse the performance interpretation. Both label and score columns are target attributes and must stay outside subgroup descriptions.

What the measures detect

MeasurePositive quality means
ROCAUCQFSubgroup ROC AUC is lower than dataset ROC AUC
PRAUCQFSubgroup precision–recall area is lower
ARLQFSubgroup average ranking loss is higher

ROC AUC is the probability of a positive scoring above a negative, counting ties as half. It requires both labels. PR area here uses trapezoidal integration, including the initial precision of one; it is not scikit-learn’s average precision. ARL is the average number of negatives ranked above a positive, so it depends on the number of negatives as well as their ordering.

For ROC AUC, the weighted score is

q(G)=nGαcb(G)β(AUC(D)−AUC(G)),q(G)=n_G^\alpha cb(G)^\beta\left(AUC(D)-AUC(G)\right),

where cbcb is the minority/majority class-count ratio. The constructor names the balance weight first (β\beta) and size weight second (α\alpha); keyword arguments make this unambiguous. A subgroup with an undefined metric scores -inf and is not reported. MinPositivesFilter alone does not ensure negatives.

Read the curves and sample sizes

<Figure size 600x550 with 1 Axes>

The dataset curve provides the reference; subgroup curves show local ranking. Their shapes may be jagged because some groups contain few positive-negative pairs. A lower AUC does not automatically imply lower accuracy at the operating threshold, worse calibration, or a causal explanation for performance loss. Those are different audit questions.

Choice of weights affects discovery and pruning

Without weights, a tiny group with a single reversed pair can be very extreme. Size and balance weights favor effects supported by more observations and both classes. The implemented bound is useful without weighting or with 0<α≤β0<\alpha\le\beta. Unsupported weight combinations can still be scored, but their optimistic estimate may be infinite and provide no pruning.

Exploration is not confirmation

These audit rows were not used to fit the classifier, but they were used to choose the subgroup descriptions. Their subgroup performance estimates are still selected. The validation chapter introduces independent subgroup validation, and the complete audit workflow keeps training, discovery, and validation separate.

Experiment. Repeat with ROCAUCQF() and with PRAUCQF(1, 0.5). Are the same descriptions preferred? Inspect class balance and both curves before interpreting disagreement as a contradiction.

References
  1. Siegl, T., Coşkun, K., Hiller, B. C., Mirzaei, A., Lemmerich, F., & Becker, M. (2025). SubROC: AUC-Based Discovery of Exceptional Subgroup Performance for Binary Classifiers. 10.48550/arXiv.2505.11283