Hi,
My function for Predict (week 3, exercise 4) produces a result that does not pass the test. Result:
*Output of predict: shape (4,), value [0. 0. 0. 1.] *
AssertionError: Wrong output: Expected : [1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0] got: [0. 0. 0. 0. 0. 0. 0. 1.]
if I change the indentation of my P ifelse statement to be in line with the nested loop above I get:
Output of predict: shape (4,), value [0. 1. 1. 1.]
AssertionError: Wrong output: Expected : [1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0] got: [1. 1. 1. 1. 1. 1. 1. 1.]
I’ve tried:
-rewatching the week three course videos but cannot find one on prediction so I’m a bit lost troubleshooting.
-experimented with various indentations of my ifelse code, the results change but still dont pass.
-Used all of the hints, and tried replacing my ifelse statement with the p[i] code provided in the hint, but this also doesn’t pass the test.
I know we’re not to display solution code here (although mine is wrong so perhaps there’s not harm?) but if someone could offer to help perhaps there’s a way i can share my code with you?
Many thanks for any support in advance,
James