LGBM-rs
Unofficial Rust bindings for LightGBM
Requirement
Windows or Linux
- Install LightGBM and build according to LightGBM Documentation.
- Set the environment variable
LIGHTGBM_LIB_PATHto the directory containing the build output (.dlland.libon Windows,.soon Linux).
MacOS
Run the following command to install LightGBM on your system.
Example
Cargo.toml
[]
= "0.0.1"
main.rs
use ;
use Arc;
output
num_data : 4
num_class : 3
num_2 : 1
| 0 | 1 | 2 |
---|---------|---------|---------|
0 | 0.99998 | 0.00001 | 0.00001 |
1 | 0.00001 | 0.99998 | 0.00001 |
2 | 0.00001 | 0.00001 | 0.99998 |
3 | 0.99998 | 0.00001 | 0.00001 |
Static linking or dynamic linking
The following types of linking are supported.
| os | static | dynamic |
|---|---|---|
| Windows | ✔ | ✔ |
| Linux | ✔ | ✔ |
| MacOS | ✔ |
On Windows, if lib_lightgbm.dll exists in the directory specified by LIGHTGBM_LIB_PATH, it will be dynamically linked. Otherwise, it will be statically linked.
On Linux, if lib_lightgbm.a exists in the directory specified by LIGHTGBM_LIB_PATH, it is statically linked. Otherwise, it is dynamically linked.
License
This project is licensed under MIT. See the LICENSE files for details.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you will be under the MIT license, without any additional terms or conditions.