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

Unable to suppress parameter alias related warnings #4518

Closed
Tracked by #5153
memeplex opened this issue Aug 13, 2021 · 9 comments · Fixed by #5253
Closed
Tracked by #5153

Unable to suppress parameter alias related warnings #4518

memeplex opened this issue Aug 13, 2021 · 9 comments · Fixed by #5253
Labels

Comments

@memeplex
Copy link

Description

Many parameter aliases trigger warnings that may be annoying and repetitive, specially in the context of model selection using grid search. These warnings can't be silenced except by changing the parameter to some specific alias. Often, this specific alias is not the one "recommended" (most used or first listed) in the documentation.

Reproducible example

See #3641 (comment)

Environment info

LightGBM version or commit hash: 3.2.1

@StrikerRUS
Copy link
Collaborator

@jameslamb I believe it's rather bug than feature request. Users ask to not print warnings (via verbose=-1) but this one is printed.

@jameslamb
Copy link
Collaborator

sure, fine with me

@rm17tink
Copy link

rm17tink commented Apr 4, 2022

None of these comments or links work. They are circuitous to suppressing the [LightGBM] [Warning]

@StrikerRUS
Copy link
Collaborator

@rm17tink What exact warning you're trying to suppress? We aren't aware of any warnings other than

[LightGBM] [Warning] param_alias_1 is set=xxx, param_alias_2=yyy will be ignored. Current value: param_alias_1=xxx

which cannot be suppressing by verbosity=-1.

@jameslamb jameslamb mentioned this issue Apr 14, 2022
60 tasks
@jmoralez
Copy link
Collaborator

jmoralez commented May 25, 2022

These warnings are coming from

static void KeyAliasTransform(std::unordered_map<std::string, std::string>* params) {

which is called before setting the logging level. I believe if we set the logging level before this:
ParameterAlias::KeyAliasTransform(&params);

we can fix the issue. I've tried it locally and it works, I'm jut not sure if it's the right thing, so I'd like to discuss this first before opening a PR.

@StrikerRUS
Copy link
Collaborator

I believe if we set the logging level before this

How will we know a requested logging level without parsing user's params (verbosity param to be more precise)?
#3641 (comment)

@jmoralez
Copy link
Collaborator

What I was doing was something like:

int verbosity = Config().verbosity
GetInt(&verbosity, params, "verbose")
GetInt(&verbosity, params, "verbosity") 

before the alias call. So the default verbosity is used if it wasn't specified or it is set to what the user specified, and then the aliases are resolved for the other params.

@jameslamb
Copy link
Collaborator

I like your approach @jmoralez ! I'd support special handling of verbosity in ParameterAlias::KeyAliasTransform() to ensure that all log messages can be controlled by verbose.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants