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

LightGBM v4 #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

LightGBM v4 #32

wants to merge 3 commits into from

Conversation

mayer79
Copy link
Contributor

@mayer79 mayer79 commented Jun 8, 2022

There is an open PR changing the predict() interface of LightGBM:
microsoft/LightGBM#5133

We should wait with merging this PR here until the LGB PR is accepted and the upcoming LGB version is clear.

@mayer79
Copy link
Contributor Author

mayer79 commented Jul 19, 2022

Solves #33

I am using a slightly simpler switch than in "shapviz" in order to keep the code clean: If lgb has version >= 4, then use the new predict(), else the old.

@mayer79 mayer79 changed the title LightGBM v4 - do not merge yet LightGBM v4 Jul 19, 2022
R/SHAP_funcs.R Outdated
(X_train),
predcontrib = TRUE)
# New predict() interface for LGB 4
if (inherits(xgb_model, "lgb.Booster") && utils::packageVersion("lightgbm") >= 4) {

Choose a reason for hiding this comment

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

@mayer79 for your consideration.... using >= 4 means that the wrong decision will be made when testing against the current development version of {lightgbm} built from source, where the version is 3.3.2.99.

To work around that, in tidymodels/bonsai#42 I did the following:

using_newer_lightgbm_version <- function(){
    utils::packageVersion("lightgbm") > package_version("3.3.2")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is clearly better, thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants