Linear regression is an approach to model a relationship between dependent variable and independent variable.
So, what is dependent variable and independent variable?
lets understand by example, You want to make Biriyani in your home. Ingredients of Biriyani is given to you, as a result you will prepare Biriyani. Here ingredient are independent variable and Biriyani is dependent on those ingredient, so, it is dependent variable.
Now, let say, there is a party in your house and you dont have any idea of how much of ingredient is required to make Biriyani for 50 people.
Now, you called your mother, aunt to help you out. They will give you an approx amount of each ingredient, e.g 5kg rice, 4kg Chicken, 1kg potato, 100g Biriyani masala. etc(Not a recipe blog SORRY). And using these approx ingredient you will cook Biriyani for 50 people.
Here the approx weights are the parameter of the independent variable which are tuned to get the result of certain amount of Biriyani.
Biriyani_predicted=W1*X1+W2*X2+W3*X3+...Wn*Xn
X1,X2,...Xn are the independent variable(ingredients)
W1,W2,...Wn are the parameter(weights)
Biriyani_predicted is the predicted result
Now, after you served Biriyani, there is shortage of Biriyani i.e your prediction of Biriyani with those weight came out to be not accurate.
This is called the error i.e difference between actual value and predicted value. And in Linear Regression these error is used to improve the model.
Now, you calculate the shortage (Actual-predicted). And note down the difference. So, that in the next party you can tweak the weights to get the amount of Biriyani right. This part is the training of model.
A model learns from the error and tweaks its parameter, So, that it can reduce the amount of error next time.
This learning takes place iteratively for a lot of time, to get an improved result.
In the next blog post, i will get into its technical details of Linear Regression. Happy Learning!!
No comments:
Post a Comment