Skip to content

Add LGBM integration#81

Merged
nabenabe0928 merged 42 commits intooptuna:mainfrom
DanielAvdar:lgbm-intg
Feb 14, 2024
Merged

Add LGBM integration#81
nabenabe0928 merged 42 commits intooptuna:mainfrom
DanielAvdar:lgbm-intg

Conversation

@DanielAvdar
Copy link
Copy Markdown
Contributor

@DanielAvdar DanielAvdar commented Feb 9, 2024

Motivation

Progress Isolation of optuna integration modules..

Description of the changes

Add LightBGM integration and its tests.

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 37 lines in your changes are missing coverage. Please review.

Comparison is base (63b4c58) 68.34% compared to head (6ce47a0) 72.37%.

Files Patch % Lines
optuna_integration/_lightgbm_tuner/optimize.py 95.77% 17 Missing ⚠️
optuna_integration/lightgbm.py 89.06% 7 Missing ⚠️
optuna_integration/_lightgbm_tuner/sklearn.py 60.00% 6 Missing ⚠️
optuna_integration/_lightgbm_tuner/_train.py 73.33% 4 Missing ⚠️
optuna_integration/__init__.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #81      +/-   ##
==========================================
+ Coverage   68.34%   72.37%   +4.03%     
==========================================
  Files          33       39       +6     
  Lines        2805     3345     +540     
==========================================
+ Hits         1917     2421     +504     
- Misses        888      924      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DanielAvdar DanielAvdar marked this pull request as ready for review February 9, 2024 10:14
Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

I leave some comments.

  • Please use optuna_integration instead of optuna.integration and apply isort.

DanielAvdar and others added 9 commits February 13, 2024 11:17
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
Co-authored-by: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com>
@y0z
Copy link
Copy Markdown
Member

y0z commented Feb 13, 2024

Please update the description of this PR (significantly, please add a link to optuna/optuna#4484).

  • Motivation
  • Description of the changes

This helps us track the progress of the integration migration.

Following optuna/optuna#4484, as a member of the Optuna organization, I would create a counterpart to this PR, which would remove Optuna's LightGBM integration from the optuna/otpuna repository.

Do not migrate low-priority module because it will have some complex dependencies on tests and others. (Migration of low-priority modules would be done by Committers.)

Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@DanielAvdar
Copy link
Copy Markdown
Contributor Author

LGTM 🎉

@y0z thank you for your review

# Conflicts:
#	README.md
#	docs/source/reference/index.rst
#	optuna_integration/__init__.py
#	pyproject.toml
Copy link
Copy Markdown
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR! I suggested some minor changes!

DanielAvdar and others added 12 commits February 14, 2024 11:07
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your work! LGTM!

@nabenabe0928 nabenabe0928 merged commit cc3d920 into optuna:main Feb 14, 2024
params: dict = {"verbose": -1}
dataset = lgb.Dataset(np.zeros((10, 10)))

with mock.patch("optuna.integration._lightgbm_tuner.optimize.os.mkdir") as m:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nabenabe0928 What about this one? Test passing it, is that correct?

def objective(trial: optuna.trial.Trial, value: float) -> float:
trial.storage.set_trial_system_attr(
trial._trial_id,
optuna.integration._lightgbm_tuner.optimize._STEP_NAME_KEY,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nabenabe0928 What about this one? Test passing it, is that correct?

@DanielAvdar
Copy link
Copy Markdown
Contributor Author

@nabenabe0928 thank you for your review

@nabenabe0928 nabenabe0928 added this to the v3.6.0 milestone Feb 16, 2024
@nabenabe0928 nabenabe0928 added the feature Change that does not break compatibility, but affects the public interfaces. label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Change that does not break compatibility, but affects the public interfaces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants