Detect Overfitting or Underfitting in Logistic Regression Models
Logistic Regression Bias–Variance in High‑Dimensional Ads Prediction
Scenario
You are building a large‑scale binary classifier (e.g., click/conversion prediction for Google Display ads) with hundreds to thousands of mostly sparse, high‑cardinality features (one‑hot categorials, text/ids, and some numerics). The dataset is large and exhibits class imbalance.
Question
-
In this setting, does logistic regression typically underfit or overfit? Describe the conditions that drive each outcome.
-
How would you detect underfitting vs overfitting in practice (e.g., learning curves, cross‑validation)?
-
What techniques would you use to address each case (consider regularization strength, feature selection, high‑dimensional sparsity, and related tooling)?
Constraints & Assumptions
-
Preserve the scope, facts, inputs, and requested outputs from the prompt above.
-
If the prompt leaves a detail unspecified, state a reasonable assumption before relying on it.
-
Keep the answer interview-ready: concise enough to present, but concrete enough to implement or evaluate.
Clarifying Questions to Ask
-
Clarify the task, data shape, labels, constraints, and evaluation metric.
-
State assumptions behind the math or modeling technique you choose.
-
Connect theory to practical training, debugging, and deployment implications.
What a Strong Answer Covers
-
Correct definitions and formulas where the prompt requires them.
-
A practical explanation of how the method behaves on real data.
-
Trade-offs, failure modes, diagnostics, and mitigation strategies.
-
Evaluation choices that match the product or modeling objective.
Follow-up Questions
-
How would noisy labels, class imbalance, or distribution shift affect the answer?
-
What would you monitor after deployment?
-
Which baseline would you compare against first?