Reason About an Intercept Shift in Logistic Regression
Quick Overview
Analyze how a fixed logistic-regression intercept shift changes the decision boundary and classification metrics on the same labeled sample. The discussion tests careful reasoning about recall, false-positive rate, precision, ranking invariance, calibration, and threshold adjustment.
Reason About an Intercept Shift in Logistic Regression
Company: Lyft
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: medium
Interview Round: Technical Screen
# Reason About an Intercept Shift in Logistic Regression
A trained binary classifier produces
`p(x) = sigmoid(w^T x + b)`
and predicts the positive class when `p(x) >= t`, for a fixed threshold `0 < t < 1`. Without retraining `w`, the intercept is changed from `b` to `b + 10`.
Explain what changes and what does not. In particular, reason carefully about predicted-positive count, recall, false-positive rate, precision, ranking metrics, and calibration. Do not assume a balanced data set or claim a direction for a metric unless it follows from the stated conditions.
### Constraints & Assumptions
- Evaluation is performed on the same fixed labeled examples before and after the change.
- The classification threshold `t` is held fixed.
- Scores and labels are not otherwise modified.
### Clarifying Questions to Ask
- Is the threshold fixed in probability space or retuned after the shift?
- Are we discussing sample metrics on a fixed set or expected population metrics?
- Is the model score used only for classification, or also as a calibrated probability?
### What a Strong Answer Covers
- The equivalent shift in log-odds and decision boundary
- Monotonic changes that can be proven for a fixed sample
- Why precision has no guaranteed direction
- Ranking invariance versus calibration damage
- How a threshold adjustment could restore the original decisions
### Follow-up Questions
- What threshold in logit space reproduces the original classifications?
- Does ROC AUC change after adding a constant to every logit?
- What happens when nearly every example becomes positive?
- How would you diagnose whether an intercept correction is actually warranted?
Quick Answer: Analyze how a fixed logistic-regression intercept shift changes the decision boundary and classification metrics on the same labeled sample. The discussion tests careful reasoning about recall, false-positive rate, precision, ranking invariance, calibration, and threshold adjustment.
Reason About an Intercept Shift in Logistic Regression
A trained binary classifier produces
p(x) = sigmoid(w^T x + b)
and predicts the positive class when p(x) >= t, for a fixed threshold 0 < t < 1. Without retraining w, the intercept is changed from b to b + 10.
Explain what changes and what does not. In particular, reason carefully about predicted-positive count, recall, false-positive rate, precision, ranking metrics, and calibration. Do not assume a balanced data set or claim a direction for a metric unless it follows from the stated conditions.
Constraints & Assumptions
Evaluation is performed on the same fixed labeled examples before and after the change.
The classification threshold
t
is held fixed.
Scores and labels are not otherwise modified.
Clarifying Questions to Ask Guidance
Is the threshold fixed in probability space or retuned after the shift?
Are we discussing sample metrics on a fixed set or expected population metrics?
Is the model score used only for classification, or also as a calibrated probability?
What a Strong Answer Covers Guidance
The equivalent shift in log-odds and decision boundary
Monotonic changes that can be proven for a fixed sample
Why precision has no guaranteed direction
Ranking invariance versus calibration damage
How a threshold adjustment could restore the original decisions
Follow-up Questions Guidance
What threshold in logit space reproduces the original classifications?
Does ROC AUC change after adding a constant to every logit?
What happens when nearly every example becomes positive?
How would you diagnose whether an intercept correction is actually warranted?