C1_W1 gradient descent error: "cannot unpack non-iterable float object"

Hello all,

I am having issues checking my gradient descent function. My code reads up until
“tmp_J, tmp_theta = gradientDescent(tmp_X, tmp_Y, np.zeros((3, 1)), 1e-8, 700)”. I feel like the issue is in my theta function but I am stuck as to how to fix it. Any advice would be appreciated!

Not familiar with the assignment but should the gradient_descent function return J and theta not just J?!

@gent.spah thanks for that! I have resolved that problem.

I am now having issues with the shape of my arrays. I am getting the error “operands could not be broadcast together with shapes (3,1) (10,1)” in my line of code:

theta = (theta-(alpha/m)).dot(np.transpose(x)*(h-y))

I have tried everything I can think of to get the shapes to be compatible for dot multiplication and according to the formula listed above the question, the “x” should be transposed. Any help will be appreciated.