Guys I am completely baffled

I am taking the the Coursera course for Machine Learning. When I run the labs and even the optional ones. I run into constant issues, such as the image “np not defined” on the pre-written uneditable codes. What is going on??

I am so lost and this course is doing my head in. The theory all makes sense but I am very new to Python.

The “np not defined” error means you have not executed the preceding cells in the notebook. You need to do that every time you reopen or restart the notebook. Try “Cell → Run All Above” when you get that error and then run the previously failing cell again. I have not taken MLS, but in DLS, there is a lecture in which Professor Ng introduces us to how the Jupyter notebooks work and covers issues like the one that causes your error.

If you are new to python, you might want to take a python course first. MLS assumes you are already a competent python programmer.

1 Like

Good afternoon Paulinpaloalto,

Thank you for the message, I’ve taken note of this situation. Could you also direct me on how to “reset” the notebook. I want to look at it with a clean slate without any changes I’ve made. My plan of action today is to just thoroughly go over the practice labs and have another attempt at the mock exam for it :).

Kind regards, Cem

Sure, here’s a thread which shows how you can get a clean copy of any of the notebooks.

Did you check to see if there’s a lecture or any notes in the early weeks of MLS Course 1 that explain how the notebooks work? If so, it would be worth a look at those.

Actually that thread is from DLS, although the notebooks work the same way there.

There is a MLS FAQ Thread, which covers many topics and also has an equivalent to the above “get a clean copy” thread. The MLS version is a little less verbose than the DLS version, so you might find that quicker to read and it will get you to the same goal. :nerd_face:

1 Like