NN - Finding Accuracy and Visualising Decison Surface

I am not getting below

plot decision boundary.
Also unable to understand visualise.py file code.

If you are talking in terms of output, than please share your code snippet.

For visualize.py file, providing the information here.

  1. First step, line 20,21, we have just find the minimum and maximum values for x axis and y axis.
  2. Second step line: 24, we have created a mashgrid, its more like creating a cartesian plane mentioning all points on graph, with xcoordinate and ycoordinate having distance between them as h = 0.01 here.
  3. Third step, line: 26, we have taken predictions of our model for every point on cartesian plane, nearly (height * width) points will be there.
  4. Forth and last step, line: 29-33, we have plotted the required plot using contourf which fills the color in the contour itself, and scatter plot.

Hope this helped you.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.