"literanger" as alternative backend for random forest (faster prediction) #648
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Offer the "literanger" package as an alternative backend for faster prediction from random forest models.
literanger is more-or-less the same algorithm as ranger but with a refactored interface that reduces overhead in prediction (fewer copy semantics and more generous use of templates on the C++ side).
It uses a marginally different (but generally equivalent) procedure for drawing the predicted value. A randomly selected tree is drawn first (for each missing value) and then a randomly selected observed value is drawn from the leaf node (that the missing value belongs to).
Not all forest types and split rules from the original ranger package, however, are currently supported.
Here's some short examples of the difference in elapsed time on my laptop (Ryzen 4900HS Ubuntu 22.04)