I am on exercise 2 in week three’s practice lab (logistic regression). My code works for the first test, which is w and b being zeros, but it fails on the second test. What should I do…
Hi, Tuva.
Welcome to the DLAI Forums! I am not a mentor for that particular course, but the best thing to do to get help would be to show us the output of the failing tests that you are seeing. Just “copy/paste” all the output here, so that the MLS mentors will have a better chance of being able to give you concrete advice when they have time to read this thread.
Regards,
Paul
I believe this notebook has a complete set of “Hints” sections for the coding.
Please give those a look.
The most common mistake in this assignment is having incorrect indentation. That’s how Python defines blocks of code.
Another common mistake is not using the sigmoid() function, or in using global variables instead of the function parameters.
Things to avoid:
- Do not add code outside of the marked areas.
- Do not add, move, or delete any cells.
I use 1/ (1+np.exp(prediction model)) for sigmoid function. Is there really a custom function like sigmoid(prediction model)??. I have also fixed it, it seems that before certainloops, I needed to clear a varible to -, because that loop is also looped by another loop, so. I was using custom variable name, so i did not match it properly with the hints, Thank you for the tip to take reference on the hint.
Tip:
Use the sigmioid() function that is part of the practice notebook.