C.W.K.
Stream
Lesson 07 of 07 · published

Gradient Boosting과 Tabular Champion

~32 min · gradient-boosting, lightgbm, xgboost

Level 0Scout
0 XP0/48 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

왜 boosting이 tabular에서 이기나

Gradient boosting이 tree를 sequential하게 빌드, 각 tree가 이전 ensemble의 residual error에 fit. 결과는 production에 충분히 interpretable 유지하면서 복잡한 interaction 잡는 strong learner. LightGBM, XGBoost, CatBoost가 Kaggle tabular leaderboard와 enterprise scoring system 대부분 지배.

중요한 세 손잡이

  • learning_rate — 작게(0.01-0.05) + 많은 tree + early stopping이 안전한 플레이.
  • num_leaves / max_depth — tree 별 용량. lightgbm 31 leaf 또는 xgboost depth 6에서 시작.
  • min_data_in_leaf / min_child_samples — regularizer. 작거나 noisy 데이터엔 올려.

정직한 workflow

항상 early stopping 동반한 validation set 사용. learning rate를 n_estimator와 함께 튜닝(낮은 lr → 더 많은 tree). CV score와 train/val gap 추적. gap 폭발하면 더 regularize. booster를 JSON이나 native format으로 save해서 나중에 inspect.

Code

early stopping과 CV 스타일 training 동반한 LightGBM·python
import lightgbm as lgb

model = lgb.LGBMClassifier(
    n_estimators=2000, learning_rate=0.03,
    num_leaves=63, min_child_samples=30,
    subsample=0.8, colsample_bytree=0.8,
    class_weight="balanced", random_state=7
)
model.fit(
    X_tr, y_tr, eval_set=[(X_val, y_val)],
    eval_metric="average_precision",
    callbacks=[lgb.early_stopping(50), lgb.log_evaluation(100)]
)
histogram method 동반한 XGBoost·python
import xgboost as xgb

model = xgb.XGBClassifier(
    n_estimators=2000, learning_rate=0.03, max_depth=6,
    subsample=0.8, colsample_bytree=0.8,
    tree_method="hist", eval_metric="aucpr",
    early_stopping_rounds=50, random_state=7
)
model.fit(X_tr, y_tr, eval_set=[(X_val, y_val)])
categorical이 메인 스토리일 때 CatBoost·python
from catboost import CatBoostClassifier, Pool

cat_idx = [X_tr.columns.get_loc(c) for c in categorical_cols]
model = CatBoostClassifier(
    iterations=2000, learning_rate=0.03, depth=8,
    auto_class_weights="Balanced", random_seed=7, verbose=200
).fit(Pool(X_tr, y_tr, cat_features=cat_idx), eval_set=Pool(X_val, y_val, cat_features=cat_idx), early_stopping_rounds=50)

External links

Exercise

dataset에 early stopping 동반한 LightGBM classifier train. logistic regression baseline 대비 PR-AUC 비교. LightGBM이 5% 넘게 이기면 deployment 차이(메모리, latency, monitoring) 계획. 미만이면 더 단순한 거 ship.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.