File failed to load: https://cdnjs.loli.net/ajax/libs/mathjax/2.7.5/jax/element/mml/optable/GreekAndCoptic.js

catboost(categorical boosting)

1.原理

https://zhuanlan.zhihu.com/p/540956200

https://arxiv.org/pdf/1706.09516.pdf

https://zhuanlan.zhihu.com/p/108110195

1.Categorical feature

2.Ordered boosting

预测

多棵树组合

xgboost,lightgbm,catboost对比

1.类别特征处理

xgboost:不能直接处理

lightgbm:内置,会有target leakage问题

catboost:内置, 没有target leakage问题

2.训练速度

lightgbm>catboost>xgboost

3.过拟合处理

xgboost,lightgbm:调参解决

catboost:利用Ordered boosting防止过拟合

2.使用

查看节点分裂

model.get_borders()

特征重要性

get_feature_importance

特征选择

select_features

树可视化

plot_tree

调参

分布式训练

catboost-spark

3.问题

xgboost

1.原理

paper原文 https://arxiv.org/pdf/1603.02754.pdf

XGBoost算法原理小结 https://www.cnblogs.com/pinard/p/10979808.html

是对gbdt的高效实现

基学习器:XGBoost的可以使用cart回归树作为基学习器,也可以使用线性分类器作为基学习器

2.使用

XGBoost类库使用小结 https://www.cnblogs.com/pinard/p/11114748.html

训练慢

gpu

histogram

single-precision

类别特征

xgboost无法处理类别特征,需要自己处理

1.one hot encode

2.label encode

GBDT

GBDT (Gradient Boosting Decison Tree)=Gradient Boosting+cart回归树

注意是cart回归树,不是cart分类树

说白了就是gradient boosting基学习器为cart回归树

gradient boosting算法流程:

1.初始化:f0(x)=argminγNi=1L(yi,γ)

2.for m=1 to M:
(a). 计算负梯度: ˜yi=L(yi,fm1(xi))fm1(xi),i=1,2N
(b). 通过最小化平方误差,用基学习器hm(x)拟合~yiwm=argminwNi=1[˜yihm(xi;w)]2
(c). 使用line search确定步长ρm,使L最小,ρm=argminρNi=1L(yi,fm1(xi)+ρhm(xi;wm))
(d). fm(x)=fm1(x)+ρmhm(x;wm)

3.输出fM(x)

GBDT算法流程:

  1. 初始化: f0(x)=argminγNi=1L(yi,γ)
  2. for m=1 to M:
    (a). 计算负梯度: ˜yi=L(yi,fm1(xi))fm1(xi),i=1,2N
    (b). {Rjm}J1=argmin{Rjm}J1Ni=1[˜yihm(xi;{Rjm,bjm}J1)]2
    (c). γjm=argminγxiRjmL(yi,fm1(xi)+γ)
    (d). fm(x)=fm1(x)+Jj=1γjmI(xRjm)
  3. 输出fM(x)

参考

https://blog.csdn.net/zpalyq110/article/details/79527653

https://zhuanlan.zhihu.com/p/86354141

gradient boosting

推导过程

Gradient Boosting为boosting算法的一种,采用和AdaBoost同样的加法模型,在第m次迭代中,前m-1个基学习器都是固定的,即

fm(x)=fm1(x)+ρmhm(x)

核心思想是得到基学习器hm(x)和权重pm

参数空间的梯度下降很常见,即

θ=θαθL(θ)

若将f(x)当成参数,则同样可以使用函数空间的梯度下降法

fm(x)=fm1(x)ρmfm1(x)L(y,fm1(x))

对比(1)(2),我们发现hm(x)L(y,fm1(x))fm1(x)

算法流程:

1.初始化:f0(x)=argminγNi=1L(yi,γ)

2.for m=1 to M:
(a). 计算负梯度: ˜yi=L(yi,fm1(xi))fm1(xi),i=1,2N
(b). 通过最小化平方误差,用基学习器hm(x)拟合~yiwm=argminwNi=1[˜yihm(xi;w)]2
(c). 使用line search确定步长ρm,使L最小,ρm=argminρNi=1L(yi,fm1(xi)+ρhm(xi;wm))
(d). fm(x)=fm1(x)+ρmhm(x;wm)

3.输出fM(x)

参考

https://www.cnblogs.com/zhubinwang/p/5170087.html

https://www.cnblogs.com/massquantity/p/9174746.html

集成学习

目前常见的集成学习可以分类为:1.Bagging 2.Boosting 3.Stacking 4.Blending

1.Bagging

bagging是解决variance问题。

2.Boosting

boosting是解决bias问题。

Bagging,Boosting二者之间的区别

https://zhuanlan.zhihu.com/p/81340270

3.Stacking

stacking和boosting的最大区别在于:boosting的基学习器是一个,stacking的基学习器是多个

4.Blending

和stacking区别: https://www.jianshu.com/p/4380cd1def76

参考

https://zhuanlan.zhihu.com/p/105038453

https://zhuanlan.zhihu.com/p/126968534

https://blog.csdn.net/starter_____/article/details/79328749


愿学术自由之风劲吹。

From《斯坦福大学校训》

Provider-Kyanite