#run-time #binding #dynamic #lib #set #sure #treelite

treerite

Rust binding for treelite runtime (https://github.com/dmlc/treelite)

1 unstable release

0.1.0 Jan 13, 2021

#13 in #sure

Custom license

5MB
12K SLoC

C++ 6K SLoC // 0.1% comments Python 3.5K SLoC // 0.2% comments Rust 1.5K SLoC // 0.0% comments Java 851 SLoC // 0.3% comments Scala 284 SLoC // 0.2% comments Shell 251 SLoC // 0.2% comments C 91 SLoC Batch 27 SLoC

Contains (ELF lib, 29KB) examples/iris.so

TreeRite: TreeLite runtime in Rust CI

This binding currently works for treelite 1.0.0rc1

Usage

  • Make sure your machine has cmake, libstdc++ and libgomp installed.
  • Add this to your project's Cargo.toml.
    treerite = { git = "https://github.com/dovahcrow/treerite" }
    

By default, the treerite library is static linked to your binary. If you'd like to use the dynamic lib, set the dynamic feature of treerite.

Documentation

There's no documentation available yet. But you can take a look at the example folder and the tests folder. The usage should be quite straight forward: you first load the Predictor from a shared library of the model. Then, load the data from Vec or ndarray::Array2 into DMatrix. Finally, you do prediction using Predictor::predict_batch(dmatrix).

TODO

  • TreeliteDMatrixCreateFromCSR
  • TreeliteDMatrixCreateFromFile

Dependencies