Crates.io | lightgbm2 |
lib.rs | lightgbm2 |
version | 0.3.0 |
source | src |
created_at | 2023-01-31 17:40:01.982913 |
updated_at | 2023-01-31 17:40:01.982913 |
description | Machine learning using LightGBM |
homepage | |
repository | https://github.com/vaaaaanquish/LightGBM |
max_upload_size | |
id | 772845 |
size | 22,793 |
LightGBM Rust binding
This fork is a work in progress. I pretends to update the package from vaaaaanquish
.
You need an environment that can build LightGBM.
# linux
apt install -y cmake libclang-dev libc++-dev gcc-multilib
# OS X
brew install cmake libomp
On Windows
LIBCLANG_PATH
to PATH_TO_LLVM_BINARY (example: C:\Program Files\LLVM\bin
)Please see below for details.
Example LightGBM train.
extern crate serde_json;
use lightgbm::{Dataset, Booster};
use serde_json::json;
let data = vec![vec![1.0, 0.1, 0.2, 0.1],
vec![0.7, 0.4, 0.5, 0.1],
vec![0.9, 0.8, 0.5, 0.1],
vec![0.2, 0.2, 0.8, 0.7],
vec![0.1, 0.7, 1.0, 0.9]];
let label = vec![0.0, 0.0, 0.0, 1.0, 1.0];
let dataset = Dataset::from_mat(data, label).unwrap();
let params = json!{
{
"num_iterations": 3,
"objective": "binary",
"metric": "auc"
}
};
let bst = Booster::train(dataset, ¶ms).unwrap();
Please see the ./examples
for details.
example | link |
---|---|
binary classification | link |
multiclass classification | link |
regression | link |
git clone --recursive https://github.com/andreclaudino/lightgbm-rs
docker build -t lgbmrs .
docker run -it -v $PWD:/app lgbmrs bash
# cargo build
Much reference was made to implementation and documentation. Thanks.