# 2 Linear Regression with One Variable

## Model Representation

$$m$$ : the number of training examples

$$x$$ : input variables

$$y$$ : output variables

$$(x, y)$$ : a single training example

$$(x^{(i)}, y^{(i)})$$ : refer to the ith training example

$$h$$ : representing the hypothesis

## Cost Function

$$J({\theta }_0, {\theta }_1) = \frac {1}{2m}\sum ^{m}_{i=1}( h_{\theta }(x^{(i)}) – y^{(i)})^2$$

Cost function is also called the squared error function or sometimes called the square error cost function.

$${\theta }_j := {\theta }_j – {\alpha }\frac {\partial }{\partial {\theta }_j}J({\theta }_0 – {\theta }_1)$$ (for j = 0 and j = 1)