-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add ability to export as sklearn RF #587
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## mainline #587 +/- ##
============================================
+ Coverage 84.80% 84.87% +0.06%
============================================
Files 75 77 +2
Lines 6587 6743 +156
Branches 528 531 +3
============================================
+ Hits 5586 5723 +137
- Misses 1001 1020 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks great! One question for my own benefit, but it should not block merge.
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.
Looks reasonable to me. Left a few comments which are mostly for my education.
It could be good to add some tests to trigger the various "this model can't be exported to scikit-learn" conditions. That way it is tested and we make codecov happy.
Could also be worth having one test that uses a round trip from scikit-learn to scikit-learn to check that all the fitted attributes (the ones ending in _
) are set to the right value (or not set if not supported)
Co-authored-by: Tim Head <betatim@gmail.com>
Created #588 to remind myself to remove the pin |
Treelite 4.4.1 contains the following improvements and fixes: * Add ability to export as sklearn RF dmlc/treelite#587 * Fix missing includes by dmlc/treelite#591, needed to build latest Triton-FIL backend Authors: - Philip Hyunsu Cho (https://github.com/hcho3) - James Lamb (https://github.com/jameslamb) Approvers: - James Lamb (https://github.com/jameslamb) - Tim Head (https://github.com/betatim) - Dante Gama Dessavre (https://github.com/dantegd) URL: #6212
This PR adds a function to export Treelite models as scikit-learn random forests.
It makes use of the field accessor API.
Usage:
Limitations
predict()
andpredict_proba()
return correct result. Other estimator metadata may be missing or incorrect.