1.
If there is a new area, assuming that there is no record of the price of the sale, and we want to know the price of the sale of the house, what should we do? The green dots in the figure are the points we want to predict.
Suppose we know the red line, then give the size of the house, and we can give the price of the house immediately. Therefore, we need to find such a red line.
2. Model Building
Just now we think that the price of housing is only related to area. In real life, the factors that affect house prices are many, such as the size of the house, the direction, the area, the number of rooms and so on. Considering more cases, we use X1,X2...XN to describe the factors that affect the price of a house, which are called features in machine learning. such as the area of x1= room, x2= room orientation and so on. Considering two variables, we can make an estimate function:
Θ is referred to here as the parameter, θ effect can adjust the price of the house various factors of the effect of the size. In other words, the factor that affects the price of a house is whether the area is more important or the room orientation is more important.
We make x0 = 1, we can use vectors to represent
In the above formula, once Theta is determined, then our straight line is determined, and we are able to forecast the house price. So the job we're going to do is to determine theta.
The value of θ can have countless, how should we choose θ?
3. Model Establishment-least squares
Only θ in the above equation is unknown, how to solve the minimum value of the function. Generally, the derivation of the objective function, the derivative is 0, the point to be obtained, that is, the extremum point, if the function is a convex function within the defined field, then the extremum point is the most value point. The above method is the least squares approach.
4. On the function extremum:
1. Gradient Descent method
2. Batch processing gradient descent method
3. Random Gradient Descent method
Linear regression (least squares,)