The fifth job linear regression algorithm

1. The key knowledge points in this section are summed up in your own words, can be accompanied by pictures, and explain the importance of the knowledge points

1) The difference between regression and classification:

2) The definition of linear regression and the equation of multiple linear equations:

3) There is a certain error between the linear regression machine prediction and the true value:

 

 

 

4) The formula of the loss function, that is, the formula for calculating the size of the error:

 

 

 

5) Linear regression algorithm, strategy and optimization:

 

 

 

6) Understanding the formula of the gradient descent algorithm of least square method:

 

 

 

7) Two graphics effects of gradient descent algorithm:

 

 

 

 

 

 8) The specific code of the gradient algorithm in the course:

 

 

 

2. Thinking about what linear regression algorithms can be used for? (Everyone try not to write duplicates)

The linear regression algorithm mainly uses correlation data to predict another set of related data. For example: predict the level of house prices, the rise and fall of stocks, the level of wages, the sales of movie tickets and so on.

 

3. Write a linear regression algorithm independently, the data can be made by yourself, or obtained from the Internet. (Plus points)

Case: Through the relationship between seniority and monthly salary, draw a relevant graph, and can be used to predict monthly salary through seniority.

Source code:

 

 

 operation result:

It can be seen that the higher the seniority, the higher the monthly salary.

 

Guess you like

Origin www.cnblogs.com/fqy1028/p/12743784.html