Getting code error in linear regression model with one variable (code assignment)

What is the issue in this ? I think the issue is f" string format but couldn’t edit the code

Hi , @Mohammad_Taufeeq_Khan

The issue is that your compute_cost function is returning a numpy array instead of a single float number

Check these that points in your code:

If you are using a for loop make sure cost = (f_wb - y[i])^2 and you add cost_sum correctly also check that the return line is outside the loop.

If you are using vectorization make sure you sum everything with np.sum(...) so it does not stay an array

also you can check if you are run the cells from up to down correctly .

Hello @omarWael

Sorted now, thank you!

You are welcome!
Wishing you great success with your course.

Hello @omarWael ,

Just to let you know that I am struggling with “practice quiz - the problem of overfitting” - (course 1 - week 3), the answers I have selected are correct but system is not considering to pass the practice quiz.

I am attaching a screenshot for your reference:

Please look into issue. Thank you!

Hello @Mohammad_Taufeeq_Khan,

This is a multiple-select question. You need to select all correct answers to get all of the points.

Cheers,
Raymond