Calculate Posterior Probability of Flagged User Being Bad Actor
MetaData Scientist · OnsiteLast updated
Evaluates Bayesian inference and confusion-matrix reasoning for abuse detection. Strong answers derive posterior precision from prevalence, TPR, and FPR, define Type I and Type II errors, and compute true positives and false positives for 10 million users.
Scenario
Platform must distinguish good users from potential bad actors using Bayesian inference while controlling error rates.
Question
Given a prior probability p of a user being a bad actor and classifier outputs with known true-positive and false-positive rates, derive the posterior probability that a flagged user is truly bad. Define Type I and Type II errors in this context and explain their business impact. If 1 % of 10 million users are truly bad and the classifier has 95 % recall and 2 % false-positive rate, calculate the expected number of bad actors caught and the expected number of good users incorrectly flagged.
Hints
Apply Bayes’ theorem, build a 2×2 confusion matrix, compute expected counts from prevalence and error rates.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.