欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

xgboost论文公式解析

发布时间:2023/12/20 编程问答 36 豆豆
生活随笔 收集整理的这篇文章主要介绍了 xgboost论文公式解析 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

<XGBoost: A Scalable Tree Boosting System>
论文结构如下:
1.介绍。
2.回顾boosting Tree以及作者做的一系列修改
3.寻找最佳分割点的算法
4.加速设计
5.相关工作
6.评价

可以看出,论文的重点是第3部分,其他都是在优化和加速上面的工作。

原始论文式(1)
yi^=ϕ(xi)=∑k=1Kfk(xi),f∈F\hat{y_i}=\phi(x_i)=\sum_{k=1}^Kf_k(x_i),f\in Fyi^=ϕ(xi)=k=1Kfk(xi),fF
K:K个弱分类器

where F={f(x)=wq(x)}F=\{f(x)=w_{q(x)}\}F={f(x)=wq(x)}
原文提到:
“here q represents the structure of each tree that maps an example to the correspoding leaf index”
意思就是:
q(x)表示x这条测试数据到达了哪一个叶子节点

原始论文式(3)
L~(t)=∑i=1n[gift(xi)+12hift2(xi)]+Ω(ft)\tilde{L}^{(t)}=\sum_{i=1}^n[g_if_t(x_i)+\frac{1}{2}h_if_t^2(x_i)]+Ω(f_t)L~(t)=i=1n[gift(xi)+21hift2(xi)]+Ω(ft)

原始论文:
expanding Ω(ftf_tft) as follows:
\--------------------------
原始论文式(2)
L(ϕ)=∑il(yi^,yi)+∑kΩ(fk)L(\phi)=\sum_{i}l(\hat{y_i},y_i)+\sum_{k}Ω(f_k)L(ϕ)=il(yi^,yi)+kΩ(fk)
where Ω(f)=γT+12λ∣∣w∣∣2Ω(f)=\gamma T+\frac{1}{2}\lambda||w||^2Ω(f)=γT+21λw2
引用:
Here lll a differentiable convex loss function that measures
the difference between the prediction y^i\hat{y}_iy^iand the target yiy_iyi.
The second term Ω penalizes the complexity of the model
(i.e., the regression tree functions). The additional regular-
ization term helps to smooth the final learnt weights to avoid
over-fitting.
也就是说:这是一个可以微分的凸函数,是可以求得最小值的。

\--------------------------
原始论文式(3)
泰勒公式展开到二阶近似:
L(t)≈∑i=1n[l(yi,y^(t−1))+gift(xi)+12hift2(xi)]+Ω(fk)L^{(t)}\approx\sum_{i=1}^n[l(y_i,\hat{y}^{(t-1)})+g_if_t(x_i)+\frac{1}{2}h_if_t^2(x_i)]+Ω(f_k)L(t)i=1n[l(yi,y^(t1))gift(xi)+21hift2(xi)]+Ω(fk)
这里的n表示的n条数据
引文:
Formally,let yi^t\hat{y_i}^{t}yi^t be the prediction of the i-th instance at the t-th iteration,we will need to add ftf_tft to minimize the following objecte.
gi=∂y^(t−1)l(yi,y^(t−1))g_i=∂_{\hat{y}^{(t-1)}}l(y_i,\hat{y}^{(t-1)})gi=y^(t1)l(yi,y^(t1))
hi=∂y^(t−1)2l(yi,y^(t−1))h_i=∂_{\hat{y}^{(t-1)}}^2l(y_i,\hat{y}^{(t-1)})hi=y^(t1)2l(yi,y^(t1))
\--------------------------
原始论文式(4)
L~(t)=∑i=1n[gift(xi)+12hift2(xi)]+γT+12λ∑j=1Twj2\tilde{L}^{(t)}=\sum_{i=1}^n[g_if_t(x_i)+\frac{1}{2}h_if_t^2(x_i)]+\gamma T+\frac{1}{2}\lambda\sum_{j=1}^T{w_j^2}L~(t)=i=1n[gift(xi)+21hift2(xi)]+γT+21λj=1Twj2

这个式子继续往下推需要这么几个关系式(论文中没有提到):

12∑j=1T∑i∈Ijhiwj2=12∑i=1nhift2(xi)\frac{1}{2}\sum_{j=1}^T\sum_{i\in I_j}h_iw_j^2=\frac{1}{2}\sum_{i=1}^n h_if_t^2(x_i)21j=1TiIjhiwj2=21i=1nhift2(xi)

∑j=1T(∑i∈Ijgi)wj=∑i=1ngift(xi)\sum_{j=1}^T(\sum_{i\in I_j}g_i)w_j=\sum_{i=1}^ng_if_t(x_i)j=1T(iIjgi)wj=i=1ngift(xi)

wj=ft(xi)w_j=f_t(x_i)wj=ft(xi)

T:叶子数量

IjI_jIj:到达第j个叶子的数据集
wjw_jwj:第j个叶子的权重,原文是:
“we use wiw_iwi to represent score on i-th leaf”

=∑j=1T[(∑i∈Ijgj)wj+12(∑i∈Ijhi+λ)wj2]+γT=\sum_{j=1}^T[(\sum_{i\in I_j}g_j)w_j+\frac{1}{2}(\sum_{i\in{I_j}}h_i+\lambda)w_j^2]+\gamma T=j=1T[(iIjgj)wj+21(iIjhi+λ)wj2]+γT

\--------------------------
原始论文式(5)
wj∗=−∑i∈Ijgi∑i∈Ijhi+λw_j^{*}=-\frac{\sum_{i\in I_j}g_i}{\sum_{i \in I_j}h_i+\lambda}wj=iIjhi+λiIjgi

\--------------------------
把式(5)带入(4)得到原始论文式(6):
L~(t)(q)=−12∑j=1T(∑i∈Ijgi)2∑i∈Ijhj+λ+γT\tilde{L}^{(t)}(q)=-\frac{1}{2}\sum_{j=1}^T\frac{(\sum_{i\in I_j}g_i)^2}{\sum_{i \in{I_j}}h_j+\lambda}+\gamma TL~(t)(q)=21j=1TiIjhj+λ(iIjgi)2+γT

\--------------------------
然后是式(7),评价指标为:
Lsplit=12[(∑i∈ILgi)2∑i∈ILhi+λ+(∑i∈IRgi)2∑i∈IRhi+λ−(∑i∈Igi)2∑i∈Ihi+λ]−γL_{split}=\frac{1}{2}[\frac{(\sum_{i\in{I_L}}g_i)^2}{\sum_{i \in I_L}h_i+\lambda}+\frac{(\sum_{i\in{I_R}}g_i)^2}{\sum_{i \in I_R}h_i+\lambda}- \frac{(\sum_{i\in{I}}g_i)^2}{\sum_{i \in I}h_i+\lambda} ]-\gammaLsplit=21[iILhi+λ(iILgi)2+iIRhi+λ(iIRgi)2iIhi+λ(iIgi)2]γ

\--------------------------
这里还采用了"Column Subsampling"技术,
也就是每棵树采用其中几个特征进行独自生成cart树,最后把每个cart树的预测值相加,就是整个XGBOOST集成模型的最终预测值

总结

以上是生活随笔为你收集整理的xgboost论文公式解析的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。