Week 3 practice lab: logistic regression error

Hi Friends,
When I run my code, it says “all tests passed” for all code sections. However, when I submit my workbook for grading, it gives me following error. I tried everything that I could but really stuck. Please guide me how to troubleshoot this issue.

Code Cell UNQ_C1: Function ‘sigmoid’ is correct.
Code Cell UNQ_C2: Function ‘compute_cost’ is correct.
Code Cell UNQ_C3: Function ‘compute_gradient’ is correct.
Code Cell UNQ_C4: Function ‘predict’ is correct.
Code Cell UNQ_C5: Function ‘compute_cost_reg’ is incorrect. Check implementation.
Code Cell UNQ_C6: Function ‘compute_gradient_reg’ is incorrect. Check implementation.
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.

Your code does not work correctly for some of the tests the grader uses.

2 Likes

Check for use of global variables or hard coded dimensions.

2 Likes

Thank you. I checked for global variables and dimesions but still I coouldn’t resolve it. What else should I do? Please help.

Sorry, i am away from my course resourses, so there is not very much i can do in detail. I will be better available in two days.

There is some issue with how your code computes the regularized terms. It seems to only work with the tests in the notebook. The grader uses different tests, with different sizes of data and different conditions.

Thank you!
It is very helpful to know that grader uses different tests. Meanwhile, I will keep trying.

Hi,
Do you have any update for me, please?

Sorry, I am a little confused. What sort of update are you expecting?

Hi,
My apologies for any confusion. I thought you will be able to help me when you have access to course resources. I am unable to figure out what is incorrect in my code as error message is generic. Any guidance you can provide will be very helpful.

Hi @jvchaudhari

This error may be caused by some dependencies of other functions:

If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.
This dependency may be the cause of the errors.

That means that the error in the last Code Cell UNQ_C6 might be relate to some error in Code Cell UNQ_C5 and so on.

Please, check the Code Cell UNQ_C5 in order to understand if it’s causing an error on Code Cell UNQ_C6.

Check your personal messages for instructions.

2 Likes

I accidentally delete the files of the last week’s practice lab. How can I fix that? when I try to open it, it says 404: not found

See the instructions in the FAQ: