Module 4 · Lesson 4 of 618/56 in the course~20 min
Module lessons (4/6)
Regularization
Lesson preview5 hands-on exercises readyMachine Learning: from first principles to practice · Module 4 — Generalization and evaluation
Ridge and Lasso penalties and choosing alpha with held-out data.
What you'll learn in this lesson
- Explain regularisation as a penalty on large weights.
- Use Ridge and Lasso and describe how they differ.
- Choose the regularisation strength with held-out data.
Overview
An overfit polynomial wiggles wildly, and wild wiggles need large weights. Regularisation adds a penalty for large weights to the loss, so the model only uses big weights when the data really demand them. The result is a smoother, more cautious model.
The number alpha sets the strength: 0 means no penalty (plain least squares), and a very large alpha squashes the weights towards zero, which underfits.
Sections covered in this lesson
- 1The hook: keep the model on a leash
- 2Try it: add regularisation to the polynomial lab
- 3Ridge vs. Lasso vs. ElasticNet
- 4Progressive examples: penalties in action
- 5Practice
- 6Check your understanding
Pro Lesson · Module 4 — Generalization and evaluation
Unlock "Regularization" and the full Machine Learning: from first principles to practice curriculum
Ridge and Lasso penalties and choosing alpha with held-out data.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Machine Learning: from first principles to practice plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.