Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OptunaのintegrationにあるLightGBM Tunerのデフォルト探索範囲

Last updated at Posted at 2024-03-29

はじめに

Optunaにはimportして使うだけでLightGBMのパラメータ探索までやってくれる便利なモジュールが存在する。それがOptunaのintegrationに入っている。しかし、公式ドキュメントを見てもGitHubのコードに飛ばされるだけで、どのパラメータをどの範囲で探索しているのかは公開されていない。

そこでデフォルトの探索範囲をしっかり確認してみようと思う。

結論

パラメータ探索範囲
{
    "lambda_l1": {"min": 1e-8, "max": 10.0, "log": True},
    "lambda_l2": {"min": 1e-8, "max": 10.0, "log": True},
    "num_leaves": {"min": 2, "max": 16},
    "feature_fraction": {"min": 0.4, "max": 1.0 + 1e-12},
    "bagging_fraction": {"min": 0.4, "max": 1.0 + 1e-12},
    "bagging_freq": {"min": 1, "max": 7},
    "min_child_samples": {"min": 5, "max": 100}
}

説明

まず、pip show optunaを使用して、パッケージをインストールしているディレクトリに移動する。

.../site-packages/optuna/integration/lightgbm_tuner/optimize.py というファイルがあると思うので、この198行目から226行目あたり(バージョンによっては違うかも)に_preprocessという関数が定義されている。

定数として45, 48行目くらいに、_DEFAULT_TUNER_TREE_DEPTH = 8と、_EPS = 1e-12と定められています。

これらの部分からパラメータを抽出すると、以上のような結果になります。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?