Lightgbm: Warning message says "you didn't set num_leaves" even if I explicitly set num_leaves=31

Created on 11 Mar 2020  Â·  7Comments  Â·  Source: microsoft/LightGBM

Environment info

Operating System: Ubuntu 18.04.3 LTS

CPU/GPU model: Not sure (running in AWS EC2)

C++/Python/R version: GCC 7.5/Python 3.7.5


LightGBM version or commit hash: 6b6709

Error message

[LightGBM] [Warning] Accuracy may be bad since you didn't set num_leaves and 2^max_depth > num_leaves

Steps to reproduce

Fit any model with num_leaves = 31 and max_depth >= 5

At line 307 of src/io/config.cpp, the check for whether to show the warning can't tell whether num_leaves is 31 because that's the default or because 31 was explicitly passed. The text "you didn't set num_leaves" in the message is confusing if I did explicitly set num_leaves to 31.

Most helpful comment

Will do, thanks :)

@bfrobin446, do you want me to do it or since you were so precise with the description, do you want to get your hands dirty and do it yourself? I'm fine either way, just let me know what you prefer ;)

On Fri, 20 Mar 2020, 20:59 Nikita Titov, notifications@github.com wrote:

I agree that the current warning message is far from perfect. Contribution
is more than welcome! Feel free to propose a PR.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/LightGBM/issues/2898#issuecomment-601908378,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6K4MI2NPSXYWA5F4LHYZLRIPKLRANCNFSM4LF6LEIQ
.

All 7 comments

Hello @bfrobin446 ,

What would you like to see instead?

"Accuracy may be bad as num_leaves < 2^max_depth, with num_leaves=x." ?

Maybe something like "The default num_leaves setting of 31 may be too low for best accuracy when 2^max_depth > num_leaves. Consider increasing num_leaves or reducing max_depth."

I'll leave that to @StrikerRUS, what's your input on this?

I agree that the current warning message is far from perfect. Contribution is more than welcome! Feel free to propose a PR.

Will do, thanks :)

@bfrobin446, do you want me to do it or since you were so precise with the description, do you want to get your hands dirty and do it yourself? I'm fine either way, just let me know what you prefer ;)

On Fri, 20 Mar 2020, 20:59 Nikita Titov, notifications@github.com wrote:

I agree that the current warning message is far from perfect. Contribution
is more than welcome! Feel free to propose a PR.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/LightGBM/issues/2898#issuecomment-601908378,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA6K4MI2NPSXYWA5F4LHYZLRIPKLRANCNFSM4LF6LEIQ
.

Agree with @bfrobin446 . This happens when I'm refering to Chinese documentations, where said we should let
classes< num_leaves< 2^max_depth. I took it and I got this warning, by changing which to num_leaves >2^max_depth it disappeared.
So by saying

[LightGBM] [Warning] Accuracy may be bad since you didn't set num_leaves and 2^max_depth > num_leaves,

what are you really suggesting? Should be 2^max_depth > num_leaves or 2^max_depth < num_leaves?
This is confusing. If you take

[LightGBM] [Warning] Accuracy may be bad since you didn't set num_leaves OR 2^max_depth > num_leaves

Agreements would likely be reached.

I can submit a PR this or next week as bfrobin446 didn't reply.

Was this page helpful?
0 / 5 - 0 ratings