Exercice 1 week 2 assignement cost error

I did everything as it should be done but I got this error message and I don’t know how to correct the code

cost at initial w: being so high indicates error in your codes.

Make sure you have initialise your parameters correctly.

Refer the hints below the grader cell compute cost.

if unable to find the issue, send the code for this grader cell via personal DM. Click my name and then message.


After reviewing your codes,

please compare your grader cell with the image I am sharing, you can see yourself where you have gone wrong. you have edited the template code. Kindly re-do this assignment based on the image template given. even if you are recalling cost_sum separately, which is fine. you have recalled cost outside the start code here. the cost code line, there is an extra tuple.

I wrote my codes without using cost_sum and the given template code. so what correction could you do make the correct.

if your cost += to code you have written

then use total_cost = only (1/(2 *m)) * cost

then won’t require cost_sum extra code line.

refer the hints, your codes are almost correct. but editing can cause such failure.

Thanks for you helpp, it was meaningful as it helped me pay more attention to the details
but actually the problem was due to a lack of attention, also my code works really well except that for the total_cost assertion I didn’t write well the operations I forgot to put the parenthesis: instead of writing (1/(2m)) I wrote (1/2m)

This is a very common mistake. Nice work on catching it!