梯度提升的變體

Python 的 Ensemble 方法

Román de las Heras

Data Scientist, Appodeal

梯度提升的各種變化

梯度提升演算法

  • Extreme Gradient Boosting
  • Light Gradient Boosting Machine
  • Categorical Boosting

實作

  • XGBoost
  • LightGBM
  • CatBoost
Python 的 Ensemble 方法

極端梯度提升(XGBoost)

部分特性:

  • 為分散式運算最佳化
  • 天生可並行訓練
  • 具延展性、可攜且精準
import xgboost as xgb

clf_xgb = xgb.XGBClassifier(
   n_estimators=100,
   learning_rate=None,
   max_depth=None,
   random_state
)
clg_xgb.fit(X_train, y_train)
pred = clf_xgb.predict(X_test)
Python 的 Ensemble 方法

Light Gradient Boosting Machine

部分特性:

  • Microsoft 於 2017 年發布
  • 訓練更快、效率更高
  • 佔用空間更小
  • 對並行與 GPU 處理最佳化
  • 適合大型資料集與速度或記憶體受限的問題
import lightgbm as lgb

clf_lgb = lgb.LGBMClassifier(
   n_estimators=100,
   learning_rate=0.1,
   max_depth=-1,
   random_state
)
clf_lgb.fit(X_train, y_train)
pred = clf_lgb.predict(X_test)
Python 的 Ensemble 方法

類別型提升(CatBoost)

部分特性:

  • Yandex 於 2017 年 4 月開源
  • 內建處理類別型特徵
  • 精確且穩健
  • 快速且可擴充
  • 友善的 API
import catboost as cb

clf_cat = cb.CatBoostClassifier(
   n_estimators=None,
   learning_rate=None,
   max_depth=None,
   random_state
)
clf_cat.fit(X_train, y_train)
pred = clf_cat.predict(X_test)
Python 的 Ensemble 方法

換你動手!

Python 的 Ensemble 方法

Preparing Video For Download...