-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: master
Are you sure you want to change the base?
LightGBM v4 #32
Conversation
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 |
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) { |
There was a problem hiding this comment.
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")
}
There was a problem hiding this comment.
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.
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.