W 3 A1 | Ex- 9 | Writing code for predictions

Please help how to write code for predictions ???

Hi, Khushboo.

If the cell is throwing value error then you are giving the wrong input to call the functions in the previous cells. Please check the nn_model (ex-8).

But I am able to run the nn_model successfully…

Hi Khushboo,

It happens that after using a wrong input for a function or using any global variable within the graded function or doing a copy/paste could throw an error in the later cells.

I think you need to go through the codes again.

Also, did you miss running any of the cells in between? Please have a closer to each of these.

Hi. Thanks for your efforts. But I am still not able to find the bug. Making a change in my line of predictions code. I got assertion error as shown in figure below:
Earlier line of code: predictions = True if (np.array(A2) >0.5) else False
New line of code: predictions = True if ((A2.all()) >0.5) else False

Hello Khushboo,

Please DM me your notebook. I want to go through the codes once.

I was right, Khushboo.

You were writing codes wrong for predictions. Please look at the notifications closer:

What it is asking for and how are you implementing it?

That is what making this difference :slight_smile:

Keep the codes straight without using if and but.

1 Like

Thank you so much. I got it solved.

You are welcome, Khushboo.