Crates.io | catboost-rs |
lib.rs | catboost-rs |
version | 0.1.8 |
source | src |
created_at | 2022-09-08 15:10:11.691386 |
updated_at | 2022-10-21 14:50:16.376744 |
description | Unofficial Rust bindings for Catboost (Machine Learning Gradient Boosting Library from Yandex) |
homepage | |
repository | https://github.com/jlloh/catboost-rs |
max_upload_size | |
id | 661130 |
size | 78,451 |
Cargo package can be found here
onnxruntime-rs
catboost-sys
one attempts to rebuild the shared library, whereas this one downloads it from the github release page.build.rs
script is with assumption libcatboost
shared library already downloaded separately.Send
so that it can be used across threads, due to the documentation stating it's thread safe. Note that this is not yet extensively tested though.apt-get install -y curl build-essential pkg-config libssl-dev libclang-dev clang cmake
https://github.com/catboost/catboost/releases/tag/v1.0.6
.
libcatboostmodel.so
libcatboostmodel.dylib
/usr/lib/
x.x.1
, e.g. sudo ln -s libcatboostmodel.so libcatboostmodel.so.1
[dependencies]
catboost-rs = "0.1.6"
libcatboostmodel.so
. If you are using Mac, download libcatboostmodel.dylib
. As of the present, only version 1.0.6 is supported./usr/lib
// Bring catboost module into the scope
use catboost_rs as catboost;
fn main() {
// Load the trained model
let model = catboost::Model::load("tmp/model.bin").unwrap();
println!("Number of cat features {}", model.get_cat_features_count());
println!("Number of float features {}", model.get_float_features_count());
// Apply the model
let prediction = model
.calc_model_prediction(
vec![
vec![-10.0, 5.0, 753.0],
vec![30.0, 1.0, 760.0],
vec![40.0, 0.1, 705.0],
],
vec![
vec![String::from("north")],
vec![String::from("south")],
vec![String::from("south")],
],
)
.unwrap();
println!("Prediction {:?}", prediction);
}
Run cargo doc --open
in catboost/rust-package
directory.
Run cargo test
in catboost/rust-package
directory.