-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Lightgbm trains much slower than catboost. #6456
Comments
Hey @fengshansi, thanks for using LightGBM. Unfortunately, this isn't enough information, we'd also need the following:
For 3,000 samples 5 minutes sounds like a lot so I'm guessing your custom metric is being the bottleneck here but it's very hard to tell with just this information. |
Thank you for your help.
|
How long does it take if you remove your custom metric? |
Thanks for using LightGBM. Could you also provide information about how catboost is used? In my experience, the speed of catboost varies a lot depending on the tree structure you select and the boosting mode. These choices often make trade-offs between speed and performance. |
Also 5 minutes. I use metric= "binary_logloss". |
{ |
Without data and working code, I fear we are stuck here. |
Here is code and data https://github.com/fengshansi/lgbm_compare. |
@fengshansi can you try using the same parameters in both? For example you're setting 0.3 as the learning rate for LightGBM and 0.7 for CatBoost, which should converge faster. Also the default leaves in LightGBM is 31 and you're using a depth of 6 in CatBoost, which produces 64 leaves. |
@fengshansi : On my laptop (8 threads), running your two notebooks gives: LightGBMCatBoostThus, LightGBM is 4-5 times faster (using pip install) |
Ooops :-). I have reset the notebook kernels before running each of them. |
I reinstalled lightgbm. But still very slow. With Python 3.11.4 and lightgbm 4.3.0. |
On Ubuntu 22.04.2 LTS,python version 3.11.4,lightgbm 4.3.0。
Data size is 3000.
params
feval:
I use several categorical_features.
I need 5 minutes to train, much slower than catboost.
The text was updated successfully, but these errors were encountered: