Add. Model evaluation and model selection

pull/2/head
benjas 5 years ago
parent def646dd53
commit 0a2ae9a5fc

@ -41,7 +41,7 @@ Supervised learning
Element of statistical learning
模型(假设空间)
#### 模型(假设空间)
> 假设所有的点都在空间中,每个点是一个模型或者函数
@ -81,3 +81,65 @@ Element of statistical learning
> 让为0的概率越来越大让为1的概率越来越小
经验风险最小化:
![1617691844212](assets/1617691844212.png)
> 对每个样本跑一遍将所有的loss平均计算loss越大表示离真实的越大loss越小说明里真实越接近模型也越好
结构风险最小化:
![1617691949906](assets/1617691949906.png)
> 加入正则项,防止过拟合,也就是模型过于复杂,过于只适合当前数据,导致预测其它数据的时候很差(泛化能力)。
算法:挑选一个合适的算法,使得可以求解最优模型
### 模型评估与选择
Model evaluation and model selection
训练误差:
![1617692106744](assets/1617692106744.png)
> 对所有训练数据的结果做一个平均,误差越大模型可能越大。但如果以训练集来评估,就想考试一样,如果考试题目平时已经见过,当然能做出来,要解决的是平均没见过的类似题目。
测试误差:
![1617692141368](assets/1617692141368.png)
> 利用测试集去测试模型的训练情况。
验证集:我们通常来讲,会挑选测试集表现最好的,但是也有总可能就是测试集刚好和训练集的“题目”类似,那它当然能表现的好,这时候就需要引入验证集。我们一般选择验证集表现最好的模型。
多项式拟合问题:
![1617692653540](assets/1617692653540.png)
> 左上欠拟合严重,右上欠拟合,左下拟合正常,右下过拟合。实际中怎么判断过拟合,即训练集上误差非常低,但是在其它数据集上的误差非常高,一般就是过拟合。
### 正则化与交叉验证
Regularization and cross validation
防止过拟合
最小化结构风险:
![1617692872918](assets/1617692872918.png)
交叉验证:
数据集随机划分为以下3部分
- 训练集:模型的训练
- 测试集:模型的选择
- 验证集:模型的评估
![1617692942593](assets/1617692942593.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Loading…
Cancel
Save