W2 Exercise 8, 2nd Iteration seems to fail test

Hi!

I have been able to run all tests up until exercise 8 in the week 2 programming exercise. When I run the tests as part of the new model code, I receive the following error:

I added some print statements, and it seems to get through the first iteration but fail on the second one when assigning the next test set to y_prediction_test. Any thoughts on where my issue might be?

I would look carefully at your predict logic. Your predict function is probably correct if it passed the earlier tests, but you may be invoking it incorrectly. I’m a little worried when you talk about “the next test set”: there is only one test set and one training set, right?

You get 6% and 2% accuracy, which is essentially impossible with this dataset. Even if you predict all 0 or all 1, you’ll do better than that. :nerd_face:

But maybe the bigger problem is the shape mismatch: it looks like your Y_prediction_test value is 4 x 3, but it should be 1 x 3. So how could that happen?

Thank you! I was able to figure out what I was doing wrong pretty quickly based on your response. Much appreicated.

  • Brad
1 Like

Nice work! That’s great news that you were able to understand the issue just based on those suggestions.

There is a lot of interesting material ahead. Onward! :nerd_face: