Determine Posterior Probability of Bad User Prediction

Quick Overview

Meta Bayes theorem question on a bad-actor classifier, covering prevalence, sensitivity, specificity, false positives, positive predictive value, and the base-rate effect.

Determine Posterior Probability of Bad User Prediction

Company: Meta

Role: Data Scientist

Category: Statistics & Math

Difficulty: easy

Interview Round: Onsite

##### Scenario Evaluating a classifier that flags bad actors ##### Question 5 % of users are actually bad. The model labels a user correctly with 95 % accuracy for both classes. If the model predicts a user is bad, what is the posterior probability the user is truly bad? ##### Hints Direct application of Bayes’ rule with symmetric 95 % true-positive and false-positive complements.

Quick Answer: Meta Bayes theorem question on a bad-actor classifier, covering prevalence, sensitivity, specificity, false positives, positive predictive value, and the base-rate effect.

|Home/Statistics & Math/Meta
Meta logo
Meta
Jul 12, 2025, 6:59 PM
easyData ScientistOnsiteStatistics & Math
33
0

Posterior Probability for a Bad-Actor Classifier

You are evaluating a binary classifier that flags bad actors among users.

Given:

  • 5% of users are truly bad.
  • The model has 95% sensitivity: it correctly flags 95% of truly bad users.
  • The model has 95% specificity: it correctly labels 95% of truly good users as good.

If the model predicts that a user is bad, what is the posterior probability that the user is truly bad?

Constraints & Assumptions

  • Interpret "95% correct for both classes" as 95% sensitivity and 95% specificity.
  • Use Bayes' theorem.
  • Show the base-rate effect.
  • Report the result as a probability or percentage.

Clarifying Questions to Ask Guidance

  • Does 95% accuracy mean class-wise sensitivity and specificity, or only overall accuracy?
  • Is the 5% prevalence measured in the same population where the classifier is deployed?
  • Are there different costs for false positives and false negatives?

What a Strong Answer Covers Guidance

  • Define events for truly bad, truly good, and predicted bad.
  • Use P(Bad | Predicted Bad) = P(Predicted Bad | Bad)P(Bad) / P(Predicted Bad) .
  • Include false positives from the 95% good-user population.
  • Compute numerator 0.95 * 0.05 .
  • Compute denominator 0.95 * 0.05 + 0.05 * 0.95 .
  • Conclude that the posterior probability is 50%.
  • Explain why high class-wise accuracy can still produce only 50% precision when prevalence is low.

Follow-up Questions Guidance

  • What happens if prevalence falls to 1%?
  • How would you choose a threshold if false positives are very costly?
  • Which metric is this posterior probability also known as?
Loading comments...