Least Squares Regression
This is one of the favorite topics for people to start machine learning. It has roots more than a century. The basic problem of finding the rule behind a process lead people to think about how to create a rule from scientific measurements. Offcourse, linear relationships are the most intuitive ones. If you buy one apple it is 1$ if you buy 10 it is 10$. The fomulation in this case would be y=wx for single variable. Hoever, machine learning is reverse of the process we are not trying to find y or total amount in previous example instead we would like to find w from data. Lets extend on this apples example. If we have data like this
- 10 apples -> 9$
- 8 apples -> 8$
- 2 apples -> 3$
-
What would be your guess of w (unit price) if you assume linear relationship ?
Least square estimate is a learning mechanism by optimizing squared discripancies between model and data. So lets formulate like this
argmin_w \sum (wx-y_true)^2
In most minimization problems you take derivative and equare to zero
So \sum wx = \sum y_true
In our example x values are 10, 8 and 2. Left side becomes 20w and right becomes 20. That is w=1. As you may observe already it is average price per apple.
But definetely the real data is not coming from linear model. It seems that there is an incentive to but more apples. I just one to make the point that your assumptions could be a limiting factor in learning process.
Comments
Post a Comment