C1W4AS2: what is predict(?


I just can’t understand from where in week 4 we get predictions_train = predict(train_x, train_y, parameters) .

We had defined

  • predict(parameters, X)
  • predict(w, b, X)


I understand how predict(train_x, train_y, parameters) works, but where do we define it?

With best regards.

from dnn_app_utils_v3 import *
The function is defined in dnn_app_utils_v3.py

In a new cell if you execute help(predict), the documentation will come up.

You can visit the project dashboard by clicking on the jupyter icon.

Here’s a link for you: User interface components — Jupyter Notebook 6.5.0.dev0 documentation

You can open a terminal and start browsing the instance you’re connected to from the jupyter ui.

As @balaji.ambresh points out, that function is provided for you and becomes available with the import statement in the very first cell. You had built your own predict function in a previous week’s exercise, which helps to account for your understanding of it. Kudos!

You can see the predict() function in thednn_app_utils_v3 “module” from Jupyter Notebook: File → Open … and select it from the list.

1 Like

Thank you for the answers!