C1_W3_Logistic_Regression UNQ_C3 compute gradient expected values seem wrong

Hi,

as the title suggests it seems that the automated test is expecting wrong values for the final practice lab of the course 1 MLS.

The expected values inside the notebook (didn’t edit) are of shape (2,) and align with what I’ve got. Also that part of the practice lab is working with 2 features so it’s unlikely that the gradient will have a shape of (3,).

I’m also posting a picture of the automated test output.

If this is a grading error I’d love to submit the solution after it’s fixed :smile:

Thank you guys for a great course so far :+1:

Hey @deni.munjas,
Welcome to the community. The expected values mentioned in the markdown cell are in accordance with the test mentioned in the code cell in the notebook (the one shown by you), whereas, the “AssertionError” message shows the expected values in accordance with the unit tests, which you can find in the public_tests.py file. You can find the instructions for opening this and other related files in the following thread.

This suggests that your implementation is slightly incorrect. I guess that you have hard-coded the value of n, i.e., the number of features, but it might be something else as well. Please go through your implementation carefully, correct it, and then re-run the test cell. It would run perfectly fine. I hope this helps.

Regards,
Elemento

Thanks, @Elemento, you were right there was a slight error.
I didn’t expect the unit test to try other examples, which makes sense.

2 Likes