Related Machine Learning Links
Learn Ridge Lasso Machine Learning Tutorial, validate concepts with Ridge Lasso Machine Learning MCQ Questions, and prepare interviews through Ridge Lasso Machine Learning Interview Questions and Answers.
Ridge & Lasso Regression Q&A
20 Core Questions
Interview Prep
Ridge & Lasso Regression: Interview Q&A
Short questions and answers on L1/L2 regularization, how they control overfitting and when to use each for regression models.
Regularization
L1 vs L2
Feature Selection
Overfitting Control
1
What is regularization in machine learning?
âš¡ Beginner
Answer: Regularization adds a penalty term to the loss function to discourage overly complex models and reduce overfitting.
2
What is the key idea behind ridge regression?
âš¡ Beginner
Answer: Ridge regression adds an L2 penalty (sum of squared coefficients) to shrink coefficients towards zero but usually not exactly to zero.
3
What is the key idea behind lasso regression?
âš¡ Beginner
Answer: Lasso regression adds an L1 penalty (sum of absolute coefficients), which can drive some coefficients exactly to zero, performing feature selection.
4
What does the regularization parameter (alpha/lambda) control?
âš¡ Beginner
Answer: It controls the strength of the penalty; higher values mean stronger regularization and more shrinkage of coefficients.
5
When would you prefer ridge regression over lasso?
📊 Intermediate
Answer: Use ridge when you expect many small effects and want to keep all features but stabilize coefficients (e.g., with multicollinearity).
6
When would you prefer lasso regression?
📊 Intermediate
Answer: Use lasso when you believe only a small subset of features is truly important and you want a sparse, interpretable model.
7
How does regularization help with multicollinearity?
📊 Intermediate
Answer: By shrinking coefficients, especially in ridge, regularization stabilizes estimates when features are highly correlated.
8
Why is feature scaling important before ridge or lasso?
📊 Intermediate
Answer: Without scaling, the penalty would depend on feature units; standardizing features ensures all coefficients are penalized fairly.
9
What is elastic net regression?
🔥 Advanced
Answer: Elastic net combines L1 and L2 penalties, aiming to get both feature selection (lasso) and stability (ridge).
10
How do you typically choose the regularization strength?
📊 Intermediate
Answer: You usually pick alpha using cross‑validation, trying a grid or range of values and selecting the one with best validation performance.
11
What happens if alpha is set to zero in ridge or lasso?
âš¡ Beginner
Answer: With alpha = 0, you get ordinary least squares regression with no regularization.
12
What happens if alpha is extremely large?
📊 Intermediate
Answer: Coefficients are shrunk very close to zero, producing a very simple, underfitting model.
13
Can lasso select at most n features when there are more features than samples?
🔥 Advanced
Answer: Yes, in many settings lasso tends to select at most n non‑zero coefficients when there are n samples, due to the geometry of the L1 penalty.
14
How does regularization relate to the bias‑variance trade‑off?
🔥 Advanced
Answer: Regularization intentionally adds bias (shrinking coefficients) to achieve a larger reduction in variance, often lowering total error.
15
Why can lasso behave unstably with highly correlated features?
🔥 Advanced
Answer: Lasso may arbitrarily pick one of the correlated features and drop others, leading to unstable feature selection across different samples.
16
Why is it helpful to use pipelines with regularized models?
📊 Intermediate
Answer: Pipelines ensure that scaling and regression are applied consistently and safely inside cross‑validation and in production.
17
Does ridge or lasso change the type of loss function used?
📊 Intermediate
Answer: They keep the underlying loss (e.g., MSE) but add a penalty term on top of it in the objective being minimized.
18
How do you interpret coefficients after applying regularization?
🔥 Advanced
Answer: Coefficients are biased towards zero, but their relative magnitude and sign can still provide useful insight into feature influence (especially after scaling).
19
Name a practical use case where lasso is particularly attractive.
âš¡ Beginner
Answer: Lasso is attractive in high‑dimensional problems (e.g., many features but few samples) where you want automatic feature selection.
20
What is the main message to remember about ridge and lasso?
âš¡ Beginner
Answer: Both are simple but powerful tools to control overfitting; ridge favors stability, lasso favors sparsity—choose and tune them based on your data and goals.
Quick Recap: Ridge & Lasso
Regularization is your main lever for taming complex linear models; combine ridge, lasso or elastic net with good scaling and cross‑validation to get robust solutions.