Optional lab: cost function

In this image as we can see we took only two values for x_train and y_train
But, when we plot x_train, y_train we have many values. And we didn’t write any code in between to import any x_train, y_train values from any files. So how we are getting so many data point when we are plotting it even though we took defined two points.

Those two figures use different data sets.
There is a section of the lab titled “Larger Data Set”. It creates the larger data set.

Be sure you don’t run the cells out-of-sequence. The training data is a global variable, so it you run the “Larger Data Set” section and then go back and re-run the cell from “Cost Function Intuition”, it’s going to make that plot using the larger data set.

Please can you explain the cost function Intuition I do not understand anything about that.

1 Like