Implement Regularization in Python

Implement Regularization in Python

Today, we finished 20 lectures of the ML: Teach by Doing project. The entire playlist can be accessed for free here:

Yesterday, we looked at this data to understand regularization:

Article content

Today, we will write a Python code to implement regularization on this dataset!

I do everything from scratch in Python, without using any packages or libraries.

In Day 20 of the ML: Teach by Doing Project, I did the following:

(a) Took a complex dataset

(b) Applied logistic regression without regularization 

(c) Applied logistic regression with regularization 

(d) Demonstrated how regularization helps in preventing overfitting

(e) Explore the effects of the following hyperparameters on the ML algorithm training:

  • Step size (learning rate)
  • Number of iterations
  • Feature expansion dimensions we should choose
  • Regularization parameters

I made a video to explain all my learnings here:

My Lecture notes code files can be accessed here: Link

Stay tuned for Day 21!

To view or add a comment, sign in

Others also viewed

Explore topics