自適性提升:獲獎模型

Python 的 Ensemble 方法

Román de las Heras

Data Scientist, Appodeal

獲獎模型

關於 AdaBoost:

  • 由 Yoav Freund 與 Robert Schapire 提出(1997)
  • 2003 年獲哥德爾獎
  • 第一個實用的提升式演算法
  • 廣泛使用、知名的集成方法

哥德爾獎章

Python 的 Ensemble 方法

AdaBoost 特性

  1. 以抽樣機率分布擷取樣本
    • 困難樣本權重較高
    • 初始為均勻分布
  2. 以加權多數決結合基學習器
    • 表現較好的學習器權重較高
  3. 保證持續改進
  4. 可用於分類與迴歸

adaboost 抽樣示意

Python 的 Ensemble 方法

使用 scikit-learn 的 AdaBoost 分類器

AdaBoostClassifier

from sklearn.ensemble import AdaBoostClassifier
clf_ada = AdaBoostClassifier(
   base_estimator,
   n_estimators,
   learning_rate
)

參數

  • base_estimator
    • 預設:Decision Tree(max_depth=1)
  • n_estimators
    • 預設:50
  • learning_rate
    • 預設:1.0
    • n_estimatorslearning_rate 之間取捨
Python 的 Ensemble 方法

使用 scikit-learn 的 AdaBoost 迴歸器

AdaBoostRegressor

from sklearn.ensemble import AdaBoostRegressor
reg_ada = AdaBoostRegressor(
   base_estimator,
   n_estimators,
   learning_rate,
   loss
)

參數

  • base_estimator
    • 預設:Decision Tree(max_depth=3)
  • loss
    • linear(預設)
    • square
    • exponential
Python 的 Ensemble 方法

一起來練習吧!

Python 的 Ensemble 方法

Preparing Video For Download...