Course 1, Week 2, Exercise 7

AssertionError: Wrong values for pred. [[1. 0. 0.]] != [[1.0, 0.0, 1.0]]
getting this error, after prediction in exercise 7

Welcome to the community.

If we look at your output, the first data in an array is properly set to β€œ1”. This means your algorithm to set Y_prediction based on A is working, at least. (it does not mean, it is correct. It’s an assumption to go to the next step.) But, the 3rd data in an array does not have the right value, β€œ1”.
Of course, there is a possibility to calculate β€œA” wrongly, but, the first thing to do is to check the iteration number, i.e, loop count. If the range is not properly set, then, depending the shape, some data in Y_prediction is not updated.

1 Like

Thank you so much. I made a silly mistake that’s why it was giving me wrong answer.