Skip to content

Commit 245ed41

Browse files
1
1 parent ada34de commit 245ed41

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/ai/传统算法/线性回归.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ title: 线性回归
1313

1414
多个数据可以用$Y= β0\*X0 + β1X1 + β2X2+…… βnXn+ ε $表示。
1515

16+
## 评估数据的离散程度
17+
18+
平均值:数据相加除以数据个数
19+
20+
平均差:数据与平均值的差的绝对值相加除以数据个数
21+
22+
均方误差:数据与平均值的差的平方相加除以数据个数
23+
24+
| 数据1 | 数据2 | 平均值 | 平均差 | 均方误差 |
25+
|--------|--------|--------|--------|----------|
26+
| 0 | 0 | 0 | 0 | 0 |
27+
| -4 | 4 | 0 | 4 | 16 |
28+
| 7 | 1 | 4 | 4 | 25 |
29+
30+
我们预期中,理想效果应该是 0、0 好于 -4、4 好于 7、1。只有均方误差正确的反应了这一点。
31+
32+
1633
```python showLineNumbers
1734
import numpy as np
1835
from sklearn.linear_model import LinearRegression

0 commit comments

Comments
 (0)