-
Notifications
You must be signed in to change notification settings - Fork 7
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
remove uses of predict(reshape = TRUE) for lightgbm models (fixes #40) #41
Conversation
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.
Thanks for the PR! Implementation looks good, besides that one comment.
Confirming that
generating leaf-index or SHAP feature contributions directly using {bonsai} is not supported
isn't from our documentation? Could you supply a reprex with lightgbm only showing the kind of output you're looking for?
Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
Correct, that line about SHAP values and leaf-index "predictions" isn't from
But as I type this out, I realize...it doesn't actually matter for this PR. On both For a reproducible example of these different prediction types, you could for example see the excellent example provided in this issue: microsoft/LightGBM#5223. I'll get the tests working here shortly and request a re-review. I guess there must have been something I missed in the way that I ran them locally that differs from how this project's CI is set up, and maybe that ended up in me not noticing that some tests which are failing in CI were skipped locally. |
Much appreciated, thanks for the references! I see—our machinery might indeed trip up on that output format, as yall seem to have come across. Glad it seems there's a workaround that feels good.
|
Ok I think I've resolved the issues, sorry about that! |
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.
Perfect, thanks!
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Fixes #40.
As described in that issue, the
reshape
argument topredict.lgb.Booster()
has been removed in the development version of{lightgbm}
. This PR proposes changes to make{bonsai}
compatible with old and new versions of{lightgbm}
by removing the use of that argument.Question for Reviewers
Is the following statement true?
If not, then this PR might need some changes. See https://github.com/microsoft/LightGBM/blob/44fe591a60d7427d64997c37b22768a92c97c47b/R-package/R/lgb.Predictor.R#L323-L326 for reference on why I'm asking.
Thanks for your time and consideration.