Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptunaSearchCV does not respect verbose flag #117

Open
KiloLiuton opened this issue May 7, 2024 · 1 comment
Open

OptunaSearchCV does not respect verbose flag #117

KiloLiuton opened this issue May 7, 2024 · 1 comment
Labels
document Documentation related.

Comments

@KiloLiuton
Copy link

KiloLiuton commented May 7, 2024

Expected behavior

Calling OptunaSearchCV with argument verbose=0 should not produce any verbose output to stdout, but it still prints a warning, a study creation message, and one line for every trial performed.

Environment

  • Optuna version: 3.6.1
  • Optuna Integration version: 3.6.0
  • Python version: 3.11.8
  • OS: Ubuntu 20.04.6 LTS (Focal Fossa)

Error messages, stack traces, or logs

/tmp/ipykernel_1434112/215034810.py:9: ExperimentalWarning: OptunaSearchCV is experimental (supported from v0.17.0). The interface can change in the future.
  reg = optuna_integration.OptunaSearchCV(model, param_space, n_trials=2, verbose=0)
[I 2024-05-07 11:24:28,187] A new study created in memory with name: no-name-2885ec7c-3eb9-41c1-89e4-176866e4f9eb
[I 2024-05-07 11:24:28,241] Trial 0 finished with value: 0.7458922389714324 and parameters: {'alpha': 0.6304826468351286}. Best is trial 0 with value: 0.7458922389714324.
[I 2024-05-07 11:24:28,278] Trial 1 finished with value: 0.7346998198207924 and parameters: {'alpha': 0.13100756138334635}. Best is trial 0 with value: 0.7458922389714324.

Steps to reproduce

  1. install optuna, optuna_integration and sklearn
  2. run the following script
import optuna
import optuna_integration
from sklearn.datasets import make_regression
from sklearn.linear_model import Ridge

x, y = make_regression()
model = Ridge()
param_space = {"alpha": optuna.distributions.FloatDistribution(0.0, 1.0)}
reg = optuna_integration.OptunaSearchCV(model, param_space, n_trials=2, verbose=0)
reg = reg.fit(x, y)

Additional context (optional)

No response

@KiloLiuton KiloLiuton added the bug Something isn't working label May 7, 2024
@nzw0301
Copy link
Member

nzw0301 commented May 7, 2024

Calling OptunaSearchCV with argument verbose=0 should not produce any verbose output to stdout

Hmm, I don't think so. This argument controls OptunaSearchCV's logger, not optuna's logger as defined in the codebase. It would be great to clarify this in the docs.

@nzw0301 nzw0301 added document Documentation related. and removed bug Something isn't working labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Documentation related.
Projects
None yet
Development

No branches or pull requests

2 participants