In my implementation of finding the total cost in the week 2 homework, my code is passing the first 4 test cases but not the 5th. When I run the code in Jupyter I get 2.925 instead of 4.525. When I run the same code in PyCharm with which I am more familiar I get 3.9 instead of 4.525.

Any thoughts on what might be the problem with case 5?

Note: Please review the equation for the cost calculation - specifically where the â€ś1/(2*m)â€ť factor is applied. It should be outside the summation - yours is inside.

Youâ€™re probably correct, my first thought was a recursive application of the 1/(2*m) scaling for every iteration, giving a result more like 1/(2*m^2). But on further review, thatâ€™s not the case.

I set x[i] = w*x[i] + b, but Iâ€™m not sure why this would be the problem.
What I believe my code does is for each value in x, multiplies x by the weight and adds the bias. This becomes the new value of x[i]
Then it takes this value and computes 1/2m cost^2 and adds this to the total.

What is strange is in my own program I get 3.9 and in jyupter notebook I get 2.925.

I donâ€™t see how changing x[i] is effecting my answer because I use this updated value to represent f_wb