Week 2 Exercise 8 model assertion error

For week2 exercise 8 model function unit test, I am getting assertion error for Y_prediction_test that (1,7)!=(1,7). I’m stumped on how to debug because (1,7) does equal (1,7). All of my unit tests have passed up to this point. Any suggestions?

Sorry, there is a bug in the test code there. If you look carefully, it is printing a different “correct” shape than the one it is using in the actual assertion. It tests against x_test, but the prints using X. That probably means you are referencing a global variable in your code, instead of the parameters that are passed in. It could be also that you used X_train to compute Y_prediction_test. Your Y_prediction_test is the wrong shape. It should be (1, 3) in that case, not (1, 7).

I will file a bug against the public test file here.

1 Like