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_DIR
to the directory containing the build output (.dll
and.lib
on Windows,.so
on Linux).
MacOS
- Run
brew install lightgbm
and install LightGBM on your system. - Set the environment variable
LIGHTGBM_LIB_DIR
to the directory containinglib_lightgbm.dylib
.
Example
Cargo.toml
[]
= "0.0.5"
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_DIR
, 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_DIR
, 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.