- 1 Using linear regression to predict continuous values
- 2 Linear regression topology
- 3 How does linear regression work?
- 4 Linear regression model representation
- 5 How to find the best fit?
- 6 Estimating the parameters
- 7 Predictions with linear regression
- 8 Pros of linear regression
Coursera 课程Machine learning with python
1 Using linear regression to predict continuous values用线性回归预测Co2的排放量,线性回归是一个线性模型用来描述两个以上的变量之间的关系
2 Linear regression topology线性回归拓扑结构 (1)Simple lInear Regression
- 预测Co2的排放量与发动机大小的关系
- 独立的变量(x):发动机大小
- 非独立变量(y):Co2的排放量 (2)Multiple linear regression
- 预测Co2的排放量与发动机大小以及气缸数量的关系
- 独立变量(x):发动机大小、气缸数量等等
- 非独立变量(y):Co2排放量
θ \theta θ 0是截距、 θ \theta θ 1是梯度
5 How to find the best fit?实际y值与预测回归线上的理想y值的差距叫残留误差residual error
在数学公式里所有的残留误差用均方误差MSE表示,在求最佳线性回归时,以MSE的最小值作为最佳回归线的标准。但不是随意移动回归线去计算MSE的,而是通过两种方法去计算的。一是可以运用数学方法,二是运用优化方。
数学方式求解最佳回归线的参数(不用记住,只是介绍有这种方法,我们会用机器学习解决)
两个参数都是预测出来的,y值也是预测出来的。
线性回归的优点 (1)Very fast (2)No parameter tuning 没有参数调整 (3)Easy to understand and highly interpretable好理解