Week 1, Gradient sescent - use of data.txt file

Can you share example py file using data from data.txt file (47 value set).
I get error Overflow scaler
With fewer data (2 or 7) it works well.
Also, why you use iteration number and not compare calculated cost with last cost?

Hi @strivedi

Could you please specify which lab you are referring to from Week 1?

@strivedi, it looks like you’re referring to the week 1 lab about gradient descent.

For any lab, you can look at the other files (like data.txt) by going to the File menu and choosing Open… From there, you will see a full list of the files that you can open and look at.

This lab is an ungraded lab, and should work without any changes. I’m not sure why you’re seeing an overflow error, but it could be that you inadvertently edited something. If you are still seeing the problem, the easiest fix might be to load a fresh copy of the lab. To do this, delete or rename your current lab file and then use the lab help (? icon) link in the upper right and choose “get latest version”

As far as why the compute_cost() function iterates, what it is iterating through is the set of example values, then it is comparing the calculated cost for each of those values with the true value for each example, and then taking the average across all the examples.

1 Like