Skip to content

Commit 2487773

Browse files
npatsakulaMontana Low
authored and
Montana Low
committed
[*] lightgbm updated.
1 parent 978dd69 commit 2487773

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "lightgbm-upstream"]
22
path = lightgbm-sys/lightgbm
3-
url = https://github.com/microsoft/LightGBM/
3+
url = https://github.com/microsoft/LightGBM.git

Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ exclude = [".gitignore", ".gitmodules", "examples", "lightgbm-sys"]
1111
[dependencies]
1212
lightgbm-sys = { path = "lightgbm-sys", version = "0.3.0" }
1313
libc = "0.2.81"
14-
derive_builder = "0.5.1"
15-
serde_json = "1.0.59"
16-
polars = {version = "0.16.0", optional = true}
14+
derive_builder = "0.12"
15+
serde_json = "1"
16+
polars = {version = "0.33", optional = true}
1717

1818

1919
[features]

lightgbm-sys/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ exclude = ["README.md", ".gitlab-ci.yml", ".hgeol", ".gitignore", ".appveyor.yml
1313
cuda = []
1414

1515
[dependencies]
16-
libc = "0.2.81"
16+
libc = "0.2"
1717

1818
[build-dependencies]
19-
bindgen = "0.69"
19+
bindgen = "0.71"
2020
cmake = "0.1"

src/dataset.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub struct Dataset {
3737
pub(crate) handle: lightgbm_sys::DatasetHandle,
3838
}
3939

40-
#[link(name = "c")]
4140
impl Dataset {
4241
fn new(handle: lightgbm_sys::DatasetHandle) -> Self {
4342
Self { handle }
@@ -199,13 +198,13 @@ impl Dataset {
199198

200199
let (m, n) = dataframe.shape();
201200

202-
let label_series = &dataframe.select_series(label_col_name)?[0].cast::<Float32Type>()?;
201+
let label_series = &dataframe.select_series([label_col_name])?[0].cast(&DataType::Float32)?;
203202

204203
if label_series.null_count() != 0 {
205204
panic!("Cannot create a dataset with null values, encountered nulls when creating the label array")
206205
}
207206

208-
dataframe.drop_in_place(label_col_name)?;
207+
let _ = dataframe.drop_in_place(label_col_name)?;
209208

210209
let mut label_values = Vec::with_capacity(m);
211210

@@ -228,7 +227,7 @@ impl Dataset {
228227
panic!("Cannot create a dataset with null values, encountered nulls when creating the features array")
229228
}
230229

231-
let series = series.cast::<Float64Type>()?;
230+
let series = series.cast(&DataType::Float64)?;
232231
let ca = series.unpack::<Float64Type>()?;
233232

234233
ca.into_no_null_iter()

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ extern crate serde_json;
55
#[cfg(feature = "dataframe")]
66
extern crate polars;
77

8-
#[macro_use]
98
macro_rules! lgbm_call {
109
($x:expr) => {
1110
Error::check_return_value(unsafe { $x })

0 commit comments

Comments
 (0)