## Supervised Learning

**Regression:**Predict real value output.**Classification:**Discrete value output.

**Linear Regression**

Using this line we can predict a value that is not in the data set. As we have achieved the best results after the data set, the value will be predicted more accurately.

If there is a graph between the house of prices and size in feet two we can predict the price of the house at any value of the size of the house using the best fit line.

I am using a house price example to explain this.

**
Terms used most frequently
**

m= no. of training example

x=input variable/feature

y=output variable/target

(x,y)= single training example, one row

(x(i),y(i))= ith training example i is not power but row number

(x(2),y(2))= (1406, 232)

**
What is the hypothesis?**

Mean hθ(x)-y=small, minimum

hθ(x(i))-y(i)for 1 term.

We will be using sq. error function for regression problem to get the accurate difference,

J (θ) is called the cost function.

x |
y |

1 | 1 |

2 | 2 |

3 | 3 |

As

J (θ) =1/2m ((0.5-1)2+ (1-2)2+ (1.5-3)2)=3.5/6=0.58

At the circled point, we get minimum error minimized cost function.

Now it's time to select a learning rate. It should not be selected too much smaller because it will slow our algorithm and should not be taken so much greater than it may skip our convergence point.

Now taking derivative of our gradient descent algorithm it will become,

The algorithm will be working as the following image,