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.

What makes a subgroup interesting? Binary targets

A binary target asks whether a row has a selected label. The definition of interestingness determines whether the search favors a few extreme rows or a larger pattern with a more moderate effect. Supervised descriptive rule mining offers many related measures Kralj Novak et al., 2009Lavrač et al., 2004.

Counts first

Let NN be the dataset size, PP the number of positives, nn the subgroup size, and tt its positives. Write p=P/Np=P/N and pG=t/np_G=t/n.

StatisticDefinitionQuestion
Relative size / coveragen/Nn/NWhat fraction of all rows belongs?
Target sharet/nt/nHow common is the positive label within the subgroup?
Supportt/Nt/NWhat fraction of all rows is both covered and positive?
Recallt/Pt/PWhat fraction of positives is covered?
LiftpG/pp_G/pHow many times the dataset rate is the subgroup rate?
WRAcc / leverage(n/N)(pG−p)(n/N)(p_G-p)How much excess positive mass is covered?

“Support” has different uses across pattern-mining communities. State whether you mean subgroup size or positive joint support when reporting an analysis.

StandardQF and the size exponent

The package’s standard family is

qa(G)=(n/N)a(pG−p),0≤a≤1.q_a(G)=(n/N)^a(p_G-p),\qquad 0\le a\le1.

At a=0a=0, only the rate difference matters. At a=1a=1, the score is WRAcc. Intermediate exponents balance the two more gently. SimpleBinomialQF() is StandardQF(0.5); it is a ranking measure, not a post-search significance test.

We can reproduce the candidates from the introduction before performing a search. Here the counts are hypothetical candidate summaries.

Loading...
<Figure size 600x400 with 1 Axes>

The curves cross because the candidates trade size for deviation. This is a substantive modeling choice, not just a tuning parameter for faster execution.

Evaluate a concrete description

WRAcc: 0.18
Loading...

Despite its name, LiftQF() returns the target-share difference, StandardQF(0), rather than the ratio pG/pp_G/p. For a fixed dataset with p>0p>0, the two give the same ordering. The lift statistic in a result table is the ratio. This distinction matters when reporting numerical values.

Search direction

positive 0.18 negative -0.18 both 0.18 dtype: float64

Scores in the opposite direction can be negative. With min_quality=0, they will not be returned. For an empty subgroup, these standard measures return nan; there is no meaningful within-group rate.

Choosing a measure

Start with WRAcc when both reach and enrichment matter. Use a smaller exponent when a small, strongly enriched group is valuable, and enforce a minimum size appropriate to the application. Inspect the subgroup counts whatever the score.

ChiSquaredQF() scores a binary subgroup-versus-complement contingency table. Its test statistic rewards evidence of association and is unbounded in the search API. stat="p" returns a p-value, which is smaller for stronger evidence; the search always maximizes, so do not use raw p-values as if larger meant more interesting. A test score computed on the discovery data also does not adjust for searching many candidate descriptions.

Experiment. Search Iris with exponents 0, 0.5, and 1, holding the search space and minimum size fixed. Explain changes using both size and target share, rather than comparing quality numbers across differently defined measures.

References
  1. Kralj Novak, P., Lavrač, N., & Webb, G. I. (2009). Supervised Descriptive Rule Discovery: A Unifying Survey of Contrast Set, Emerging Pattern and Subgroup Mining. Journal of Machine Learning Research, 10, 377–403. https://jmlr.org/papers/v10/kralj-novak09a.html
  2. Lavrač, N., Kavšek, B., Flach, P., & Todorovski, L. (2004). Subgroup Discovery with CN2-SD. Journal of Machine Learning Research, 5, 153–188. https://jmlr.org/papers/v5/lavrac04a.html