L1 Versus L2 Regularization for Sparse Diagnosis Code Features
Last updated: November 29, 2026
Quick Overview
You are fitting a logistic regression to predict Type 2 diabetes onset from about 40,000 one-hot ICD-10 and procedure code features on 200,000 Aetna members. Explain how you would choose between L1, L2 and elastic net regularization and how you would tune it.
CVS Health
November 29, 20260
0
0 solved
You are fitting a logistic regression to predict Type 2 diabetes onset from about 40,000 one-hot ICD-10 and procedure code features on 200,000 Aetna members. Explain how you would choose between L1, L2 and elastic net regularization and how you would tune it.
Claims-based risk models at Aetna often have far more sparse code features than are informative, and clinicians want a short list of drivers. The interviewer is testing understanding of overfitting, the geometry of penalties and practical tuning.
What the Interviewer Expects
- Explains why the unregularized model overfits here
- Contrasts L1 sparsity with L2 shrinkage
- Recognizes correlated codes make L1 unstable and motivates elastic net
- Tunes lambda with cross validation grouped by member and split by time
- Mentions feature scaling and the intercept not being penalized
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Clinicians see a selected code flip in and out across retrains. Why, and what do you do?
- How would you group codes hierarchically to reduce dimension?
- How does regularization interact with class imbalance here?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Positives are perhaps 3% of members, features are binary and very sparse, and many codes are near-duplicates (E11.9 and E11.65, or a code and its procedure). Goals: good out of sample discrimination a...
Approach
Penalized objective: is lasso, $\a...