Saturday, May 18, 2013

Linear Regression with multiple Variables


In previous blog(Linear Regression with one variable) linear regression that we developed, we have a single feature x, the size of the house, and we wanted to use that to predict why the price of the house and this was our form of our hypothesis. But now imagine, what if we had not only the size of the house as a feature or as a variable of which to try to predict the price, but that we also knew the number of bedrooms, the number of house and the age of the home and years.
It seems like this would give us a lot more information with which to predict the price.
Lets start with example of multiple variables :

In this input feature will be not only House Size like as one variable regression but also Number of Bed Rooms,Number of Floor, Age of House also will be the feature.

Hypothesis function will change from h(x) = Θ+  Θ1 x  to h(x) = Θ+  Θ1X1   +  Θ2 X2 +  Θ3 X3 ...+  Θn Xn



For convenience of notation we define X0=1  and hypothesis function h(x) becomes as
h(x) = Θ0X0 +  Θ1X1   +  Θ2 X2 +  Θ3 X3 ...+  Θn Xn

We represents each x and Θ value as vector X and Θ as

h(x) = Θx

This hypothesis function h(x) is multivariate linear regression.

Cost function for multiple variables represents as :


Gradient Descent 
Previously in Linear Regression with one variable(n=1)
Repeat
{


}

Linear Regression with multiple variable(n > 1)

Repeat
{

}


No comments:

Post a Comment