Regularization and validation

When optimizing an ML model there are a variety of strategies to improve generalization from the training data. We can add a complexity penalty to the loss function, and we can evaluate the loss function on validation data.

Joshua Loftus



Slides, notebooks, exercises

Slides for regularization video (PDF)

Slides for lasso video (PDF)

Notebook for validation (partially complete)

Notebook for lasso (no partially complete version)


Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Loftus (2021, March 1). Neurath's Speedboat: Regularization and validation. Retrieved from

BibTeX citation

  author = {Loftus, Joshua},
  title = {Neurath's Speedboat: Regularization and validation},
  url = {},
  year = {2021}