Regularization

Step 6 of 21 in Machine Learning · Build · Medium

Penalize large weights to trade a little bias for much less variance. Ridge (L2) shrinks weights; Lasso (L1) drives some exactly to zero.

Build it

  1. Ridge & Lasso

    Implement Ridge via gradient descent; use sklearn Lasso and plot coefficient paths as λ grows.

    Done when: Ridge matches sklearn; Lasso path shows features dropping to zero.

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map