Optimize recall when a missed positive costs more than a false alarm, such as fraud screening or disease detection where a human reviews every flag anyway. Optimize precision when acting on a positive is expensive or annoying, such as sending offers or blocking accounts. Set the threshold from expected cost rather than defaulting to 0.5, by sweeping thresholds and picking the minimum expected loss.
Why interviewers ask this
This checks whether you connect a model number to a business cost. The default 0.5 threshold is an artifact of the library, not a decision, and interviewers want to hear you replace it with something derived from the relative cost of the two error types. Strong candidates also mention downstream capacity, since a review team that can only handle two hundred cases a day caps recall regardless of the math.
How to structure your answer
- Anchor the choice in the cost of each error type.
- Give one concrete example on each side.
- Explain how you turn costs into a threshold rather than defaulting to 0.5.
- Mention operational capacity as a real constraint on recall.
Example answer
I start by asking what happens to each kind of mistake. On a fraud queue, a false negative is money out the door plus a chargeback, while a false positive is thirty seconds of an analyst's time, so recall wins and I push the threshold down. On a push notification model it flips: a false positive irritates a real user and can cost you an uninstall, so I want precision even if I reach fewer people. To pick the actual number, I put a rough cost on each error type, sweep the threshold across the validation set, and plot expected cost. It usually has a clear basin, and I take the middle of the basin rather than the exact minimum, because the minimum jumps around between folds. The constraint people forget is capacity. On one fraud project the cost curve said flag about four percent of transactions, but the review team could handle roughly a thousand cases a day, so the real threshold was whatever produced a thousand. I said that plainly rather than pretending the choice was purely statistical.
Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.
See how it worksFollow-up questions to expect
- How does the F1 score relate to what you just described, and when is it the wrong summary?
- What if the cost of a false negative is unknown?
- How would you communicate that threshold choice to a compliance team?
Related data scientist questions
Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.
Predict my questions