Skip to Main Content
数据科学中的实用统计学(第2版)
book

数据科学中的实用统计学(第2版)

by Peter Bruce, Andrew Bruce, Peter Gedeck
October 2021
Intermediate to advanced content levelIntermediate to advanced
289 pages
8h 31m
Chinese
Posts & Telecom Press
Content preview from 数据科学中的实用统计学(第2版)
228
6
6-10XGBoost 默认模型与惩罚模型的误差率比较
岭回归与
Lasso
这种添加一个对模型复杂度的惩罚项来避免过拟合的方法,可以追溯到
20
世纪
70
代。最小二乘回归最小化的是残差平方和(
RSS
),参见
4.1.3
节。
岭回归
最小化残差
平方和与一个惩罚项的和,这个惩罚项是关于系数数量和大小的一个函数:
22 2
01 1
1
ˆˆ ˆˆˆ
()()
n
ii
pp
i
Yb bX bX
bb
λ
=
−− −− +++

λ
的值确定了对系数的惩罚强度,这个值越大,模型对数据过拟合的可能性就越小。
Lasso
也是同样的原理,只是它使用曼哈顿距离作为惩罚项,而不是欧氏距离:
2
01 1
1
ˆˆ ˆˆˆ
()
(|
||
|)
n
ii
pp
i
Yb bX bX
bb
α
=
−− −− +++

如果使用欧氏距离,就称为
L2
正则化;使用曼哈顿距离,就称为
L1
正则化。在
xgboost
中,参数
lambda
reg_lambda
)和
alpha
reg_alpha
)的作用也是一样的。
6.4.4
 超参数与交叉验证
xgboost
中有非常多的超参数,参见后面“
XGBoost
超参数”部分的介绍。正如在
6.4.3
中看到的,超参数的具体选择可以极大地改变模型拟合。有很多超参数组合可供选择,那
统计机器学习
229
么应该按照什么原则来进行选择呢?这个问题的一种标准解决方案就是使用交叉验证 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pandas数据清洗与建模

Pandas数据清洗与建模

丹尼尔·陈
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115569028