Hello everyone! I am trying to calculate cost function J value by this method:

and get the following error:

But I inserted those very 2 lines of code from the method description. Then why the expected result differs from my output?

Hello everyone! I am trying to calculate cost function J value by this method:

and get the following error:

But I inserted those very 2 lines of code from the method description. Then why the expected result differs from my output?

1 Like

Reread the instructions. The formula you pictured is only *part* of the whole cost function. The entire function you need to implement is just above where you screenshotted.

1 Like

Fixed that. Everything works now. Thank you, Christopher.

1 Like