Skip to content

Move optuna._lightgbm_tuner module#233

Merged
toshihikoyanase merged 3 commits intooptuna:mainfrom
milkcoffeen:move-lightgbm-tuner
Jun 13, 2025
Merged

Move optuna._lightgbm_tuner module#233
toshihikoyanase merged 3 commits intooptuna:mainfrom
milkcoffeen:move-lightgbm-tuner

Conversation

@milkcoffeen
Copy link
Copy Markdown
Contributor

Motivation

This pull request refactors the optuna_integration.lightgbm module to reorganize the lightgbm_tuner code under a new submodule structure. The changes primarily involve moving and renaming files, updating import paths, and ensuring tests and functionality remain consistent with the new structure.

Description of the changes

Moved the lightgbm_tuner folder under lightgbm
As part of this change, we've modified the import paths.

@toshihikoyanase toshihikoyanase added the sprint-20250531 PR from the online sprint event May 31, 2025. label May 31, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 8, 2025

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label Jun 8, 2025
@toshihikoyanase
Copy link
Copy Markdown
Member

@milkcoffeen The CI job failed due to type-hinting problems. Could you resolve them, please?
https://github.com/optuna/optuna-integration/actions/runs/15361094800/job/43228286984?pr=233

@toshihikoyanase toshihikoyanase self-assigned this Jun 10, 2025
@milkcoffeen
Copy link
Copy Markdown
Contributor Author

Sorry for the delayed response. I've made the correction.

@github-actions github-actions bot removed the stale Exempt from stale bot labeling. label Jun 10, 2025
@toshihikoyanase toshihikoyanase added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. label Jun 12, 2025
Copy link
Copy Markdown
Member

@toshihikoyanase toshihikoyanase left a comment

Choose a reason for hiding this comment

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

The change overall looks excellent to me, but I found some minor issues.
Could you check them?


# API from lightgbm_tuner.
for api_name in _names_from_tuners:
print(tuner.__dict__.keys())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A nit, but this line seems to be a debug print. Could you remove it?

Suggested change
print(tuner.__dict__.keys())

from optuna_integration._lightgbm_tuner.optimize import _OptunaObjectiveCV
from optuna_integration._lightgbm_tuner.optimize import LightGBMTuner
from optuna_integration._lightgbm_tuner.optimize import LightGBMTunerCV
import optuna_integration.lightgbm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In my environment, the test worked without this line.
Since we import the optuna_integration module, we might not need to import the public modules under it.

Suggested change
import optuna_integration.lightgbm

@milkcoffeen
Copy link
Copy Markdown
Contributor Author

Thank you for your review.
It has been corrected.

Copy link
Copy Markdown
Member

@toshihikoyanase toshihikoyanase 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 update. The change looks great to me.

@toshihikoyanase toshihikoyanase added this to the v4.5.0 milestone Jun 13, 2025
@toshihikoyanase toshihikoyanase changed the title move lightgbm_tuner Move optuna._lightgbm_tuner module Jun 13, 2025
@toshihikoyanase
Copy link
Copy Markdown
Member

I slightly modified the PR title. Let me merge this PR.

@toshihikoyanase toshihikoyanase merged commit 99bac29 into optuna:main Jun 13, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. sprint-20250531 PR from the online sprint event May 31, 2025.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants