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
[R] Fix global feature importance and predict with 1 sample. #7394
Conversation
* Add implementation for tree index. The parameter is not documented in C API since we should work on porting the model slicing to R instead of supporting more use of tree index. * Fix the difference between "gain" and "total_gain".
@hcho3 @hetong007 Please take a look when you are available. |
Just to confirm, with this patch, xgboost won't break |
I ran
|
Same error as you have shared. Rerunning tests with 1.4 |
@hcho3 sorry, pushed a new commit for the fix in prediction leaf, where input is only one sample but we need to return a matrix instead of vector. I rewrote the prediction conditions to mimic the old code exactly and ran tests with those reverse dependencies. |
@hetong007 I have tested both packages using devtools. |
I will back port |
* [R] Fix global feature importance. * Add implementation for tree index. The parameter is not documented in C API since we should work on porting the model slicing to R instead of supporting more use of tree index. * Fix the difference between "gain" and "total_gain". * debug. * Fix prediction.
…e. (#7394) (#7397) * [R] Fix global feature importance. * Add implementation for tree index. The parameter is not documented in C API since we should work on porting the model slicing to R instead of supporting more use of tree index. * Fix the difference between "gain" and "total_gain". * debug. * Fix prediction.
Add implementation for tree index. The parameter is not documented in C API since we
should work on porting the model slicing to R instead of supporting more use of tree
index.
Fix the difference between "gain" and "total_gain".
Related: #7260 (comment).