XGBoost、LightGBM、Catboost对比

Ophira ·
更新时间:2024-09-21
· 867 次阅读

本文主要参考Battle of the Boosting Algos: LGB, XGB, Catboost,结果与原文有出入。

文章目录1. 对比标准1.1 数据集1.2 规则1.3 版本2. 结果2.1 准确率2.2 训练时间和预测时间2.3 可解释性2.3.1 特征重要性2.3.2 SHAP值2.3.3 可视化二叉树3. 总结4. 代码参考文献 1. 对比标准 1.1 数据集 分类:Fashion MNIST(60000条数据784个特征) 回归:NYC Taxi fares(60000条数据7个特征) 大规模数据集:NYC Taxi fares(2百万条数据7个特征)

PS:本文只进行了分类的对比

1.2 规则 使用基准模型 使用相同参数训练并利用GridSearchCV调参 比较训练和预测耗时、预测分数、可解释性 1.3 版本 xgboost==0.90 lightgbm==2.3.1 catboost==0.21 2. 结果 2.1 准确率

LightGBM>XGBoost>CatBoost
在这里插入图片描述

2.2 训练时间和预测时间

CatBoost<LightGBM<XGBoost
在这里插入图片描述
在这里插入图片描述

2.3 可解释性

XGBoost=LightGBM>Catboost

2.3.1 特征重要性

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

2.3.2 SHAP值
类别 含义
0 T-shirt/top
1 Trouser
2 Pullover
3 Dress
4 Coat
5 Sandal
6 Shirt
7 Sneaker
8 Bag
9 Ankle boot

XGBoost
在这里插入图片描述

LightGBM
在这里插入图片描述
CatBoost无法开箱即用

2.3.3 可视化二叉树

XGBoost
在这里插入图片描述

LightGBM
在这里插入图片描述

CatBoost绘制树函数

3. 总结

比赛选LightGBM,工业选Catboost

4. 代码

https://download.csdn.net/download/lly1122334/12171980

参考文献 Battle of the Boosting Algos: LGB, XGB, Catboost Battle of the Boosting Algorithms mlxtend: A library of extension and helper modules for Python’s data analysis and machine learning libraries shap: A game theoretic approach to explain the output of any machine learning model http://www.picnet.com.au/blogs/guido/post/2016/09/22/xgboost-windows-x64-binaries-for-download/ Graphviz - Graph Visualization Software Windows Packages
作者:XerCis



lightgbm xgboost

需要 登录 后方可回复, 如果你还没有账号请 注册新账号