Remember that in “Regression Problems” we are taking input variables and trying to map the output on to a “continuous” expected result function.

Linear Regression with one variable is also called as “univariate linear regression”. This is just more fancy way to call it.

Linear regression with one variable is used when you want to predict a single output value from a single input value. That means you only have one x as input(attribute) and one y as output.

### The Hypothesis Function

The general form of hypothesis function is;

hθ(x)=θ0+θ1x

We give hθ values for θ0 and θ1 to get the output ‘y’. We are trying to create a function called hθ which is able to reliably map our input data to our output data.

### Cost Function

Cost function is used to measure the accuracy of our hypothesis. Cost function takes an average of all results of the hypothesis with inputs from x’s compared to actual output y’s.

Here is our cost function;

We are able to concretely measure the accuracy of our predictor function against the correct results we have so that we can predict new results we don’t have.