自适应提升:获奖模型

Python 中的集成方法

Román de las Heras

Data Scientist, Appodeal

获奖模型

关于 AdaBoost:

  • 由 Yoav Freund 和 Robert Schapire 提出(1997)
  • 2003 年获哥德尔奖
  • 第一个实用的提升算法
  • 广泛使用、知名的集成方法

godel-prize.jpg

Python 中的集成方法

AdaBoost 特性

  1. 使用抽样分布选取样本
    • 难样本权重更高
    • 初始为均匀分布
  2. 估计器以加权多数表决组合
    • 表现好的估计器权重更高
  3. 有保证的改进
  4. 适用于分类与回归

adaboost-sample.bmp

Python 中的集成方法

使用 scikit-learn 的 AdaBoost 分类器

AdaBoostClassifier

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

参数

  • base_estimator
    • 默认:决策树(max_depth=1)
  • n_estimators
    • 默认:50
  • learning_rate
    • 默认:1.0
    • n_estimatorslearning_rate 间权衡
Python 中的集成方法

使用 scikit-learn 的 AdaBoost 回归器

AdaBoostRegressor

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

参数

  • base_estimator
    • 默认:决策树(max_depth=3)
  • loss
    • linear(默认)
    • square
    • exponential
Python 中的集成方法

Passons à la pratique !

Python 中的集成方法

Preparing Video For Download...