Learning objectives
- Distinguish the share of true events flagged from the share of flags that are true events.
- Reconstruct both rates from an explicit population and an evaluation table.
Learn
A screening model generates both true and false flags. The question “what fraction of defects did we flag?” uses all defective items as the denominator. “What fraction of our flags were defects?” uses the flagged items. Bayes’ rule connects these quantities by accounting for the underlying fraction of defects and the model’s behavior on both classes. A count table can make the relationship visible before applying a formula.
Draw the table before carrying percentages from one setting to another. Put actual defect status on one axis and the model’s flag on the other. The columns or rows you sum determine which conditional claim you are making. False alarms may use a lot of review time when the underlying event is rare, even if the false-positive rate is small. If a reviewer checks only flagged items, the review might estimate the fraction of flags that are correct. It cannot directly count missed defects. A separate sampling design with a consistent reference standard for flagged and unflagged cases would be needed to compare both rates. Clearly state the time window and which kinds of defect the evaluation includes.
Extended teaching and laboratory
Probability models, distributions and dependence
A sample space lists possible outcomes; an event is a set of outcomes. A probability measure is nonnegative, assigns one to the whole space, and adds probabilities over disjoint events. Consequently P(not A)=1−P(A) and P(A or B)=P(A)+P(B)−P(A and B). A random variable maps outcomes into numerical values. The same outcome can determine several variables, so different columns do not imply independent information.
A joint table assigns probabilities to combinations. Sum over unwanted categories to obtain a marginal. Conditioning restricts the reference group: P(A|B)=P(A and B)/P(B) when P(B)>0. Bayes' rule reverses the direction using P(A|B)=P(B|A)P(A)/P(B). The denominator can be computed by summing P(B|a)P(a) over mutually exclusive, exhaustive categories a. The native rare-defect examples show why sensitivity and alert precision have different denominators; their substantial original worked reasoning remains part of this course.
Independence means joint probabilities factor into marginals for all relevant events. Conditional independence given C means P(A,B|C)=P(A|C)P(B|C), a different assertion. For two independent fair binary variables X and Y, conditioning on X+Y=1 makes them dependent: knowing X=1 forces Y=0. Selecting a subgroup can therefore create associations. Repeating a measurement is not automatically independent confirmation; shared errors or copied fields require a joint model. A chain with the assumption that C is independent of A given B factors as P(A,B,C)=P(A)P(B|A)P(C|B); the factorization follows that stated assumption, not the variable names.
Apply
A fictional packaging line produces 1,000 items of which 20 have a defined defect. A model flags 18 of those 20 and 49 of the 980 without defects. Its true-positive rate is 90% and its false-positive rate is 5%. There are 67 flags, of which 18 are true defects, or about 27%. Suppose the same conditional rates apply at a site where 100 of 1,000 are defective. It would flag 90 of the 100 and 45 of the 900 without defects. Here 90 out of 135 flags are true defects, about 67%. The different prevalence changes how a flag should be interpreted even in a model with unchanged conditional performance. Whether those rates transfer between sites is an empirical assumption.
Now change the first site’s threshold in a fictional evaluation. A stricter setting flags 14 defective items and 20 items without a defect. The fraction of flags that are correct rises to about 41%. The fraction of defects caught falls to 70%, and six defective items are missed instead of two. The smaller review queue could save staff time. It also changes the number of defective products left unflagged. To compare the settings, specify the decision the flag controls and the consequences of missed defects and unnecessary inspections. Keep those consequences separate from the arithmetic. Explain whether the numbers came from past observations, an independent evaluation, or a test case like this one.
Optional check
If the fraction of flagged items that really are defective falls at a new site, must the model’s true-positive rate have fallen?
Show the explained answer
No. A lower underlying defect rate could change the composition of flags, and other changes are possible. Use verified outcomes for flagged and unflagged items to estimate each rate separately.