Calculate Posterior Probability of a Flagged User Being a Bad Actor
A platform runs a binary classifier that flags users who might be bad actors. You know the base rate of bad actors and the classifier's true positive and false positive rates.
Constraints & Assumptions
-
Use Bayes' theorem and state the base-rate effect.
-
Let
p
be the prior probability a random user is a bad actor.
-
Let
TPR = P(flag | bad)
and
FPR = P(flag | good)
.
-
For the numeric example, use 10,000,000 users, 1% bad actors, 95% recall, and 2% false-positive rate.
Clarifying Questions to Ask
-
What action follows a flag: review, warning, rate limit, or account removal?
-
Are TPR and FPR measured on a representative sample?
-
Is the base rate stable across user segments?
Part 1 - Posterior Probability
Derive the posterior probability that a flagged user is truly a bad actor, P(bad | flag), in terms of p, TPR, and FPR.
What This Part Should Cover
-
Bayes' theorem.
-
Denominator including true positives and false positives.
-
Interpretation as precision or positive predictive value.
Part 2 - Error Types
Define Type I and Type II errors in this context and explain their business impact.
What This Part Should Cover
-
Type I as falsely flagging a good user.
-
Type II as failing to flag a bad actor.
-
Impact on user trust, appeals, fraud or abuse, support load, and platform safety.
Part 3 - Expected Counts
If 1% of 10,000,000 users are truly bad, the classifier has 95% recall and 2% false-positive rate, compute the expected number of bad actors caught and good users incorrectly flagged.
What This Part Should Cover
-
Bad actors caught:
95,000
.
-
Good users incorrectly flagged:
198,000
.
-
Optional posterior precision from the counts.
What a Strong Answer Covers
A strong answer applies Bayes' theorem correctly, explains the base-rate effect, builds the confusion matrix, and ties error rates to product and enforcement decisions.
Follow-up Questions
-
What is the posterior precision in the numeric example?
-
How would the posterior change if bad-actor prevalence doubled?
-
What threshold would you require for automatic enforcement?