Having issue with W2 programming assignment

Please help me with the error, I am not able to understand why it is not working.

Your code for total cost is incorrect.

you also seem to have edited your code cell.

Make sure your cost value is correct for the total cost value to be correct.

Check the hint section given after the grade cell.

You mostly have hard coded the path.

this post :point_down:t2: should help you understand your errors

This is another thread comment which provides you hint screenshot given in the assignment

you are suppose to first initiate cost with a value.

then in iteration for range m, your equation f_wb need to be recalled, then f_wb will be next implemented in the same iteration to the cost you initialised at beginning(remember it is cost and not total cost.

Then this cost is used to calculate the total cost with the implementation ((1/2*m)*cost which gives your total cost values

Thanks Deepti. Indeed, I had hard coded the formula. I had to follow the variable nomenclature as specified in the hints section. Thanks for your assistance.

1 Like

Great. Do try to use search tool where you find many older threads for errors you might have encountered.

always divide your error outut into steps like the overall error output for you was test fail for compute cost, which said your total cost was incorrect, then a line before that mention the cost value for iteration was incorrect, giving you hint where you need to be look upon.

keep learning!!!

1 Like