Skip to main content
ML Quest
Python Idle

Your housing price model is overfitting — it nails the training data but falls apart on new houses. The culprit: too many features and not enough constraint. Regularization is the fix, but you have two options. Ridge (L2) shrinks all coefficients evenly. Lasso (L1) drives some all the way to zero, effectively selecting features for you. Train both, compare their coefficients, and see which features Lasso considers irrelevant.

~25 minscenario510 rows
Loading Python runtime...
Goals: 5 tests
ridge_model should exist and be fitted
lasso_model should exist and be fitted
Lasso should have some zero coefficients
Ridge should have no zero coefficients
both models should achieve R2 > 0.4
Python loading...