그래디언트 부스팅

Python에서의 앙상블 기법

Román de las Heras

Data Scientist, Appodeal

그래디언트 부스팅 머신 소개

목적함수

  1. 초기 모델(약한 추정기): $y\sim f_1(X)$
  2. 잔차에 맞춘 새 모델: $y-f_1(X)\sim f_2(X)$
  3. 새로운 가법 모델: $y\sim f_1(X)+f_2(X)$
  4. 오류가 충분히 작아질 때까지 $n$회 반복
  5. 최종 가법 모델: $$y\sim f_1(X)+f_2(X)+ ... +f_n(x)=\sum_{i=1}^{n} f_i(X)$$
Python에서의 앙상블 기법

경사하강법과의 동등성

잔차 함수

경사하강법:

손실 함수

그래디언트

잔차 = 음의 그래디언트

음의 그래디언트

Python에서의 앙상블 기법

그래디언트 부스팅 분류기

그래디언트 부스팅 분류기

from sklearn.ensemble import GradientBoostingClassifier
clf_gbm = GradientBoostingClassifier(
   n_estimators=100,
   learning_rate=0.1,
   max_depth=3,
   min_samples_split,
   min_samples_leaf,
   max_features
)
  • n_estimators
    • 기본값: 100
  • learning_rate
    • 기본값: 0.1
  • max_depth
    • 기본값: 3
  • min_samples_split
  • min_samples_leaf
  • max_features
Python에서의 앙상블 기법

그래디언트 부스팅 회귀기

그래디언트 부스팅 회귀기

from sklearn.ensemble import GradientBoostingRegressor
reg_gbm = GradientBoostingRegressor(
   n_estimators=100,
   learning_rate=0.1,
   max_depth=3,
   min_samples_split,
   min_samples_leaf,
   max_features
)
Python에서의 앙상블 기법

이제 부스팅해 봅시다!

Python에서의 앙상블 기법

Preparing Video For Download...