Gradient boosting

Ensemble Methods in Python

Román de las Heras

Data Scientist, Appodeal

Úvod do gradient boosting machine

function_objective.png

  1. Počáteční model (slabý estimátor): $y\sim f_1(X)$
  2. Nový model fituje rezidua: $y-f_1(X)\sim f_2(X)$
  3. Nový aditivní model: $y\sim f_1(X)+f_2(X)$
  4. Opakovat $n$-krát nebo dokud chyba není dostatečně malá
  5. Výsledný aditivní model: $$y\sim f_1(X)+f_2(X)+ ... +f_n(x)=\sum_{i=1}^{n} f_i(X)$$
Ensemble Methods in Python

Ekvivalence s gradientním sestupem

function_residuals.png

Gradientní sestup:

function_loss.png

function_gradient.png

Rezidua = záporný gradient

function_gradient_negative.png

Ensemble Methods in Python

Gradient boosting klasifikátor

Gradient Boosting Classifier

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
    • Výchozí: 100
  • learning_rate
    • Výchozí: 0.1
  • max_depth
    • Výchozí: 3
  • min_samples_split
  • min_samples_leaf
  • max_features
Ensemble Methods in Python

Gradient boosting regresor

Gradient Boosting Regressor

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
)
Ensemble Methods in Python

Čas na boosting!

Ensemble Methods in Python

Preparing Video For Download...