Programming Assignment: Week 2 practice lab- Linear regression


why this errror

Hi @Mir_Tasleem ,

It looks like the compute_cost() failed to return a scalar value of type float. Please check the Hints against your code, and be sure the indentations are correctly used for structing code block.

Why This Error?

Hi @Keshav_Kumar3 ,

There are two tests here, the first one is just calling the compute_cost() with the initial_w =2, initial_b = 1, and then followed by two print statements to print out the result of cost. What did you get for the first test? Did it match the expected output of 75.203? If it didn’t, then the logic of your code is not right. Please check the Hints for a step by step guide. As mentioned in the my reply to the first query, be sure your code block is structed with indentations correctly.

After the first test, there is the second test, as you can see, from the public_tests folder, and your code failed case2 of the public_tests, causing the assertionError, because your code didn’t delivery the expected cost value of 2.

i am having similar problem

You have to run all the above cells.

I had the same problem-but like Saifkhanengr said, you have to run all the codes cells above