-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Implement categorical prediction for CPU and GPU predict leaf. #7001
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7001 +/- ##
=======================================
Coverage 81.71% 81.72%
=======================================
Files 13 13
Lines 3916 3917 +1
=======================================
+ Hits 3200 3201 +1
Misses 716 716
Continue to review full report at Codecov.
|
* Implement categorical prediction for CPU prediction. * Implement categorical prediction for GPU predict leaf. * Refactor the prediction functions to have unified get next.
9701e60
to
4f444c2
Compare
int tid = model.trees[j]->GetLeafIndex(feats); | ||
auto const& tree = *model.trees[j]; | ||
auto const& cats = tree.GetCategoriesMatrix(); | ||
bst_node_t tid = GetLeafIndex<true, true>(tree, feats, cats); |
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.
Should we also add a check for has_categorical
here? Or are we purposefully removing it as GetLeaf
is not performance critical?
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.
also it's possible feats
has no missing values
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.
Yes, I'm assuming it's not critical. Otherwise we will have a lot more specializations
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.
This is the previous default so I'm not slowing it down here. If optimization is needed (being the computation bottleneck of some algorithms/models), we can come back to it in a different PR that focuses on optimization.
Related: #6503 .