This is a brief summary of ML course provided by Andrew Ng and Stanford in Coursera.
You can find the lecture video and additional materials in
https://www.coursera.org/learn/machine-learning/home/welcome
Recap
we want to fit a straight line to our data.
Hypothesis: $h_{\theta} (x) = \theta_0 + \theta_1 x$
Parameters: $\theta_0, \theta_1 $
With different choices of the params, we end up with different straight line.
Cost Function: $J(\theta_0, \theta_1) = \frac{1}{2m} \sum_{i=1}^m (h_{\theta}(x^(i)) - y^(i))^2 $
Goal: minimize $\theta_0, \theta_1 J(\theta_0, \theta_1)$
Lecturer's Note
A contour plot is a graph that contains many contour lines. A contour line of a two variable function has a constant value at all points of the same line.
Taking any color and going along the 'circle', one would expect to get the same value of the cost function. For example, the three green points found on the green line above have the same value for $J(\theta_0, \theta_1)$ and as a result, they are found along the same line. The circled x displays the value of the cost function for the graph on the left when $\theta_0 = 800$ and $\theta_1 = -0,.15 $.
When $\theta_0 = 360$ and $\theta_1 = 0$, the value of $J(\theta_0, \theta_1)$ in the contour plot gets closer to the center thus reducing the cost function error.
The graph above minimizes the cost function as much as possible and consequently, the result of $\theta_1$ and $\theta_0$ tend to be around 0.12 and 250 respectively. Plotting those values on our graph to the right seems to put our point in the center of the inner most 'circle'.