本文主要參考Battle of the Boosting Algos: LGB, XGB, Catboost,結果與原文有出入。
文章目錄
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