Cousera Supervised Machine Learning week 2 linear regresssion assignment, unable to pass

I can’t seem to figure out where I am going wrong. The code is very similar to the hints yet it doesn’t give me the expected output of initial w.
Without the unnecessary additional numbers I added in the code, I get a very large number for initial w.
I’m a beginner at python and help would be appreciated :slight_smile:

{mentor edit: code removed}

1 Like

Please don’t post your code on the forum. That’s not allowed by the Code of Conduct.

Check your scaling of the cost by 1/(2*m). That gives a different result than
(1 / 2 * m).

Two things Python is extremely picky about:

  • use of parenthesis
  • use of indentation

Thanks!! That helped.