try different $\lambda$ constant


In [5]:
%reload_ext autoreload
%autoreload 2
%matplotlib inline

import sys
sys.path.append('..')

# load my own module
from helper import logistic_regression as lr

draw decision boundary

  • we want to find all those x which $X\times \theta = 0$
  • instead of solving polynomial equation, just create a coridate x,y grid that is dense enough, and find all those $X\times \theta$ that is close enough to 0, then plot them
  • zip is its own inverse!

In [6]:
lr.draw_boundary(power=6, l=1)



In [7]:
lr.draw_boundary(power=6, l=0)  # no regularization, over fitting



In [8]:
lr.draw_boundary(power=6, l=100)  # underfitting



In [ ]: