Which statement correctly describes the main difference between Ridge and Lasso regularization?
Think about which penalty type (L1 or L2) causes coefficients to become exactly zero.
Ridge uses L2 penalty which shrinks coefficients towards zero but does not make them exactly zero. Lasso uses L1 penalty which can shrink some coefficients exactly to zero, effectively performing feature selection.
What will be the output coefficients after fitting Lasso regression on the given data?
from sklearn.linear_model import Lasso import numpy as np X = np.array([[1, 2], [2, 3], [3, 4], [4, 5]]) y = np.array([3, 5, 7, 9]) model = Lasso(alpha=1.0) model.fit(X, y) coefficients = model.coef_ print(coefficients)
Recall that Lasso can zero out some coefficients depending on alpha.
With alpha=1.0, Lasso shrinks the first coefficient to zero and keeps the second close to 2, reflecting feature selection.
What happens to the coefficients of a Ridge regression model as the regularization parameter alpha increases?
Think about how L2 penalty affects coefficient size as alpha grows.
Increasing alpha in Ridge regression increases the penalty on coefficient size, causing coefficients to shrink towards zero but not exactly zero.
You have trained both Ridge and Lasso regression models on the same dataset using cross-validation. The Ridge model has a mean squared error (MSE) of 4.5, and the Lasso model has an MSE of 4.7. Which model should you choose and why?
Lower MSE means better prediction on unseen data.
Between two models, the one with lower cross-validation MSE is preferred as it predicts better on new data. Feature selection is useful but does not override predictive accuracy.
You trained a Lasso regression model on your dataset, but all coefficients are zero. What is the most likely cause?
Think about how alpha controls the strength of regularization in Lasso.
If alpha is very large, Lasso penalizes coefficients heavily, shrinking them all to zero. This is a common cause of all-zero coefficients.
