A PU correction based on constant positive-labeling probability requires selected positives to represent all positives; site-dependent confirmation can violate that assumption.
PU label selection: SCAR and site-dependent confirmation
Write the selection assumption
Under selected-completely-at-random labeling, every true positive has the same probability c of being confirmed, regardless of features. Then the probability of an observed positive at feature vector X is c times the probability of a true positive. This identity is useful only if confirmation does not depend on pump type, depot, severity or how easy a fault is to inspect.
Look for selection gradients
A high-volume depot may teardown every returned pump while a small depot files tickets only for severe cases. Confirmed positives then overrepresent that depot and severity. Compare capture policies, inspection staffing, claim channels and known audit results by slice. The code audits confirmation fractions among a small set of independently adjudicated positives; it does not establish selection independence from every unobserved feature.
Keep the denominator honest
A confirmation rate computed among all pumps is not c: it mixes true prevalence with selection. Estimating c requires information about true positives or a defensible model of the labeling process. If no such information exists, report a plausible range and the decisions that change across it. Sensitivity analysis makes that explicit.
Use local selection when justified
A selected-at-random model may let confirmation probability vary with recorded depot or inspection pathway. That still assumes no remaining selection driver after conditioning. It needs support in each stratum and careful estimation; a zero-confirmation stratum cannot be repaired by a weight. Support overlap states the adjacent identifiability issue.
Do not confuse annotation with outcome
A false ticket, duplicate claim or delayed teardown can break the implication that S equals one means Y equals one. Audit a sample of confirmed positives before choosing a PU method. The observation contract must hold before any correction is meaningful.
Implementation
adjudicated_positives = [
{"depot": "north-47", "confirmed": True},
{"depot": "north-47", "confirmed": True},
{"depot": "north-47", "confirmed": False},
{"depot": "west-62", "confirmed": True},
{"depot": "west-62", "confirmed": False},
{"depot": "west-62", "confirmed": False},
]
def confirmation_by_depot(positives):
counts = {}
for record in positives:
bucket = counts.setdefault(record["depot"], [0, 0])
bucket[0] += bool(record["confirmed"])
bucket[1] += 1
return {depot: confirmed / total for depot, (confirmed, total) in counts.items()}
fractions = confirmation_by_depot(adjudicated_positives)
assert round(fractions["north-47"], 3) == 0.667
assert round(fractions["west-62"], 3) == 0.333
assert fractions["north-47"] != fractions["west-62"]Performance and operating cost
Grouping N independently adjudicated positives costs O(N) time and O(C) memory for C depots. The audit needs enough adjudicated positives per site; small denominators make apparent differences noisy. A fraction difference is a warning, not proof of the exact labeling mechanism.
Common Mistakes
- Do not estimate positive confirmation probability from the fraction of all pumps with tickets.
- Do not assume SCAR when work practices vary across depots.
- Do not treat an observed site difference from tiny samples as a precise selection probability.
