C1_W3_Logistic_Regression exercise 2 AssertionError: Wrong output

Cost at initial w (zeros): 0.014
AssertionError: Wrong output. Expected: 2.15510667 got: 0.2665604678925331

Check your code to see if you implemented the cost calculation correctly.

It’s particularly important that you use the correct indentation for any for-loops. Python is very sensitive to indentation.

Another tip - be sure you’re only adding the bias value ‘b’ once. Don’t put ‘b’ inside a for-loop if you are iterating over the features.

Thanks - I figured out, looks like the exercise was only asking to calculate cost without the lambda, I removed it and it worked fine now. Thank you

Thanks for your report. I’m not sure why there is a lambda parameter for that function, since it isn’t used or referenced.

1 Like

Yea, its confusing why they mentioned lambda when its nor used.

Hi Yaetis, i got the same results and error as in your original post above. how did you go about removing lambda? the only reference to lambda in my code is: def compute_cost(X, y, w, b, lambda_= 1): and when i change the 1 to 0 or remove lambda entirely the Cost at initial w (zeros): 0.014 stats at 0.014 and doesnt become the expected outcome of Cost at initial w (zeros) = 0.693

Laurence has resolved the issue himself.