An open API service indexing awesome lists of open source software.

https://github.com/mirecl/leaves-rs

🌿 Leaves is a library implementing prediction code GBRT (Gradient Boosting Regression Trees) for inference models from popular ML-frameworks on Pure Rust πŸ¦€
https://github.com/mirecl/leaves-rs

Last synced: 6 months ago
JSON representation

🌿 Leaves is a library implementing prediction code GBRT (Gradient Boosting Regression Trees) for inference models from popular ML-frameworks on Pure Rust πŸ¦€

Awesome Lists containing this project

README

          

[![Latest version](https://img.shields.io/crates/v/leaves-rs.svg)](https://crates.io/crates/leaves-rs) ![License](https://img.shields.io/crates/l/leaves-rs.svg)

# 🌿 leaves-rs

🌿 Leaves is a library implementing prediction code for GBRT (Gradient Boosting Regression Trees).\
The goal of the project - make it possible to inference models from popular ML-frameworks on **Pure Rust** πŸ¦€.

### πŸ“ Install library

Run the following Cargo command in your project directory:

```sh
cargo add leaves-rs
```

Or add the following line to your **Cargo.toml**:

```toml
leaves-rs = "0.0.1"
```

### πŸ“– Proposal API for LightGBM

+ Import library for example `LGBMClassifier`:

```rust
use leaves::LGBMClassifier;
```

+ Load models:

```rust
let model = LGBMClassifier::from_file("model.bin");
```

+ Predict models:

```rust
// Create features vector.
let features = vec![1.0, 2.0, 3.0];

// Inference model `Classifier`.
let preds = model.predict(features);
let preds_proba = model.predict_proba(features);
```

> ❗The models `LGBMRegressor` and `LGBMRanker` will be executed in a similar manner.

### πŸ€” Supported framework

+ [ ] LightGBM () (in progress 🟑)
+ [ ] XGBoost ()
+ [ ] CatBoost ()
+ [ ] Scikit-Learn ()

### 🫡 Usage

+ [Regression](examples/regression)
+ [Titanic](examples/titanic)

### πŸ‘ Thanks

+ [@dmitryikh](https://github.com/dmitryikh) for