Rustrees: Decision Trees & Random Forests in Rust with Python Bindings
Overview
Rustrees is an efficient decision tree and random forest library written in Rust with Python bindings. It aims to provide speed comparable to Sklearn with the reliability and performance of Rust.
Features
- 🏎️ Speed: As fast as Sklearn on average.
- 🔗 Python Bindings: Effortless integration with Python.
- 🔒 Type Safety: Benefit from Rust's strong type system.
Python
Installation
Quick Start
=
=
=
Rust
Installation
Quick Start
use ;
let dataset = read_csv;
let dt = train_reg;
let pred = dt.predict;
println!;
Developing
First, create a virtualenv (this just needs to be done once):
Then, activate the virtualenv (needs to be done every time):
Now, install the requirements (just needs to be done once):
Finally, install the Python library at the local virtual environment with the following command (needs to be done every time you change the Rust code):
Now, you can import the library rustrees
in Python. This can be done also from Jupyter notebooks. To do so, run the following command:
And then import the library in the notebook: