How would you adjust a deployed classifier's probabilities when class priors shift but p(x | y) stays the same?

Quick Overview

Asks how to correct a deployed classifier's probabilities when class frequencies change in production while the features within each class keep the same distribution. Tests Bayes' rule reasoning, label-shift estimation without new labels, the role of calibration and the limits of the assumption.

How would you adjust a deployed classifier's probabilities when class priors shift but p(x | y) stays the same?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

A classifier was trained on data with one set of class frequencies. In production, the class frequencies have changed, but the distribution of features within each class has not. How would you adjust the model's predicted probabilities? ```hint Write Bayes' rule Write $p(y \mid x)$ with Bayes' rule and check which factors change when only the class priors move. ``` ```hint Where the new priors come from Production data usually arrives without labels. Think about what you can observe on it, and what you already measured on the validation set, that would let you estimate the new class frequencies. ``` ### What a Strong Answer Covers - The Bayes' rule argument showing which term changes and which stays fixed under label shift - The correction in the multiclass and binary cases - How to estimate the new priors without labels on the new data - Why the original model must be calibrated, and when moving the decision threshold is enough - When the assumption fails and the correction stops being valid ### Follow-up Questions - The model was trained on a 50/50 undersampled dataset. Which prior do you use as the old prior in the correction? - How would you detect that the change is not pure label shift? - What can go wrong with Black Box Shift Estimation when one class is rare in the validation set? - If you only make decisions at a fixed threshold, do you still need to adjust the probabilities?

Overview: Asks how to correct a deployed classifier's probabilities when class frequencies change in production while the features within each class keep the same distribution. Tests Bayes' rule reasoning, label-shift estimation without new labels, the role of calibration and the limits of the assumption.

General logo
General
Nov 24, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

A classifier was trained on data with one set of class frequencies. In production, the class frequencies have changed, but the distribution of features within each class has not. How would you adjust the model's predicted probabilities?

What a Strong Answer Covers Guidance

  • The Bayes' rule argument showing which term changes and which stays fixed under label shift
  • The correction in the multiclass and binary cases
  • How to estimate the new priors without labels on the new data
  • Why the original model must be calibrated, and when moving the decision threshold is enough
  • When the assumption fails and the correction stops being valid

Follow-up Questions Guidance

  • The model was trained on a 50/50 undersampled dataset. Which prior do you use as the old prior in the correction?
  • How would you detect that the change is not pure label shift?
  • What can go wrong with Black Box Shift Estimation when one class is rare in the validation set?
  • If you only make decisions at a fixed threshold, do you still need to adjust the probabilities?