1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! LightGBM Rust library
//!
//! **`lightgbm3`** supports the following features:
//! - `polars` for [polars](https://github.com/pola-rs/polars) support
//! - `openmp` for [multi-processing](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#build-threadless-version-not-recommended) support
//! - `gpu` for [GPU](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#build-gpu-version) support
//! - `cuda` for [CUDA](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#build-cuda-version) support
//!
//! # Examples
//! ### Training:
//! ```no_run
//! use lightgbm3::{Dataset, Booster};
//! use serde_json::json;
//!
//! let features = vec![vec![1.0, 0.1, 0.2],
//! vec![0.7, 0.4, 0.5],
//! vec![0.9, 0.8, 0.5],
//! vec![0.2, 0.2, 0.8],
//! vec![0.1, 0.7, 1.0]];
//! let labels = vec![0.0, 0.0, 0.0, 1.0, 1.0];
//! let dataset = Dataset::from_vec_of_vec(features, labels, true).unwrap();
//! let params = json!{
//! {
//! "num_iterations": 10,
//! "objective": "binary",
//! "metric": "auc",
//! }
//! };
//! let bst = Booster::train(dataset, ¶ms).unwrap();
//! bst.save_file("path/to/model.lgb").unwrap();
//! ```
//!
//! ### Inference:
//! ```no_run
//! use lightgbm3::{Dataset, Booster};
//!
//! let bst = Booster::from_file("path/to/model.lgb").unwrap();
//! let features = vec![1.0, 2.0, -5.0];
//! let n_features = features.len();
//! let y_pred = bst.predict_with_params(&features, n_features as i32, true, "num_threads=1").unwrap()[0];
//! ```
pub use ;
pub use ;
pub use ;
/// Get index of the element in a slice with the maximum value