Upgrade to Pro — share decks privately, control downloads, hide ads and more …

LightGBMTunerを使ってみた.pdf

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for wakame1367 wakame1367
November 30, 2019
400

 LightGBMTunerを使ってみた.pdf

Avatar for wakame1367

wakame1367

November 30, 2019
Tweet

Transcript

  1. Kaggle Days in Paris CPMP talk 10 ⚫ Don't ovetune

    your parameters: do it once, maybe twice in a competition, no more. ⚫ For XGBoost / LightGBM ⚫ Start with subsample=0.7, leave other values to default ⚫ Play with min_child_weight: increase it if train/val gap is large ⚫Then tune max_depth or num_of_leaves ⚫Add regularization if LB Score is way below CV https://www.youtube.com/watch?time_continue=1018&v=VC8Jc9_lNoY&feature=emb_title
  2. Kaggle Days in Paris CPMP talk 11 ⚫ パラメータ調整のしすぎはダメ: コンペ中にやるとしても1回・2回

    ⚫ For XGBoost / LightGBM ⚫ まずはsubsample=0.7で他はデフォルトのまま ⚫ min_child_weightはtrain/valの差が大きいなら増やそう ⚫その後max_depth or num_of_leavesを調整 ⚫もしLBがCVより低いなら正則化(L1/L2)を強めにかける https://www.youtube.com/watch?time_continue=1018&v=VC8Jc9_lNoY&feature=emb_title
  3. チューニング対象のパラメータと探索範囲 15 ⚫ feature_fraction ⚫ lambda_l1/lambda_l2 ⚫ num_leaves ⚫ min_child_samples

    ⚫ bagging_fraction ⚫ bagging_freq https://github.com/optuna/optuna/blob/master/optuna/integration/lightgbm_tuner/optimize.py#L201-L225
  4. チューニング対象のパラメータと探索範囲 16 ⚫ feature_fraction: min(trial.suggest_uniform('feature_fraction', 0.4, 1.0 + EPS), 1.0)

    ⚫ lambda_l1/lambda_l2: trial.suggest_loguniform('lambda_l1', 1e-8, 10.0) ⚫ num_leaves: trial.suggest_loguniform('lambda_l2', 1e-8, 10.0) ⚫ min_child_samples: trial.suggest_int('num_leaves', 2, 2 ** max_depth) ⚫ bagging_fraction: min(trial.suggest_uniform('bagging_fraction', 0.4, 1.0 + EPS), 1.0) ⚫ bagging_freq: trial.suggest_int('bagging_freq', 1, 7) 注) maxdepth = 8, EPS=1e-12 https://github.com/optuna/optuna/blob/master/optuna/integration/lightgbm_tuner/optimize.py#L201-L225
  5. チューニング方法 20 1. feature_fraction: _GridSamplerUniform1D 2. num_leaves: TPESampler 3. bagging_freq/bagging_fraction:

    TPESampler 4. feature_fraction: _GridSamplerUniform1D 5. lambda_l1/lambda_l2: TPESampler 6. min_child_samples: _GridSamplerUniform1D
  6. 開発者様の回答 25 ⚫ パラメータの探索範囲については経験則から決定してい るため、参考文献などはないです。ベンチマークを行い 具体的な根拠を示したり、あるいはユーザーが探索範囲を 指摘できるよう改修することで更に改良できれば良いと 考えています。参考までに AutoML 5

    での上位チームの パラメータ探索範囲を紹介します。 https://github.com/pfnet-research/KDD-Cup-AutoML-5/blob/master/optable_submission/optable_packa ge/optable/learning/optuna_hyper_params_searcher.py#L108 https://github.com/DeepBlueAI/AutoSmart/blob/master/auto_smart/auto_smart/automl/auto_lgb.py#L290
  7. ベンチマーク結果 29 ⚫ Kaggle: Elo Merchant Category Recommendation ⚫ Metric:

    Root Mean Squared Error (RMSE) ⚫ オリジナルスコア(https://www.kaggle.com/konradb/lgb-fe-lb-3-707?scriptVersionId=8086782) ⚫ Private: 3.63111 ⚫ Public: 3.70799 ⚫ Tunedスコア(https://www.kaggle.com/wakamezake/lgb-fe-lb-3-707-with-lightgbmtuner) ⚫ Private: 3.62932(0.00179 down) ⚫ Public: 3.71041(0.00242 up)
  8. ベンチマーク結果 30 ⚫ Kaggle: Recruit Restaurant Visitor Forecasting ⚫ Metric:

    Root Mean Squared Logarithmic Error(RMSLE) ⚫ オリジナルスコア(https://www.kaggle.com/meli19/py-single-light-gbm-lb-0-521) ⚫ Private: 0.54098 ⚫ Public: 0.52193 ⚫ Tunedスコア(https://www.kaggle.com/wakamezake/single-lightgbmtuner) ⚫ Private: 0.53430(0.00668 down) ⚫ Public: 0.51146(0.01047 down)