dmlc / treelite

Universal model exchange and serialization format for decision tree forests
https://treelite.readthedocs.io/en/latest/
Apache License 2.0
730 stars 98 forks source link

Add ability to export as sklearn RF #587

Open hcho3 opened 22 hours ago

hcho3 commented 22 hours ago

For now, only support RF. Support for GradientBoosting may be added later.

Usage:

# tl_model is an treelite.Model object

# Returns either RandomForestClassifier / RandomForestRegressor
clf = treelite.sklearn.export_model(tl_model)  
codecov[bot] commented 22 hours ago

Codecov Report

Attention: Patch coverage is 89.61039% with 16 lines in your changes missing coverage. Please review.

Project coverage is 84.81%. Comparing base (386f50c) to head (1defc83).

Files with missing lines Patch % Lines
python/treelite/sklearn/exporter.py 84.46% 16 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## mainline #587 +/- ## ============================================ + Coverage 84.75% 84.81% +0.06% ============================================ Files 75 77 +2 Lines 6587 6732 +145 Branches 528 531 +3 ============================================ + Hits 5583 5710 +127 - Misses 1004 1022 +18 ``` | [Flag](https://app.codecov.io/gh/dmlc/treelite/pull/587/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/dmlc/treelite/pull/587/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dmlc#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.