diff --git a/Cargo.toml b/Cargo.toml index d6e974a..598623d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lightgbm3" -version = "1.0.5" +version = "1.0.6" edition = "2021" authors = [ "Dmitry Mottl ", @@ -18,9 +18,9 @@ readme = "README.md" exclude = [".gitignore", ".github", ".gitmodules", "examples", "benches", "lightgbm3-sys"] [dependencies] -lightgbm3-sys = { path = "lightgbm3-sys", version = "1.0.4" } -serde_json = "1.0.125" -polars = { version = "0.42.0", optional = true } +lightgbm3-sys = { path = "lightgbm3-sys", version = "1" } +serde_json = "1" +polars = { version = "0.45", optional = true } [features] default = [] @@ -35,6 +35,6 @@ path = "benches/regression.rs" harness = false [dev-dependencies] -rand = "0.8.5" -rand_distr = "0.4.3" -csv = "1.3.0" +rand = "0.8" +rand_distr = "0.4" +csv = "1.3" diff --git a/lightgbm3-sys/Cargo.toml b/lightgbm3-sys/Cargo.toml index 28c1486..6782c0c 100644 --- a/lightgbm3-sys/Cargo.toml +++ b/lightgbm3-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lightgbm3-sys" -version = "1.0.5" +version = "1.0.6" edition = "2021" authors = ["Dmitry Mottl ", "vaaaaanquish <6syun9@gmail.com>"] build = "build.rs" @@ -12,12 +12,12 @@ readme = "README.md" exclude = ["README.md", ".gitlab-ci.yml", ".hgeol", ".gitignore", ".appveyor.yml", ".coveralls.yml", ".travis.yml", ".github", ".gitmodules", ".nuget", "**/*.md", "lightgbm/compute/doc", "lightgbm/compute/example", "lightgbm/compute/index.html", "lightgbm/compute/perf", "lightgbm/compute/test", "lightgbm/eigen/debug", "lightgbm/eigen/demos", "lightgbm/eigen/doc", "lightgbm/eigen/failtest", "lightgbm/eigen/test", "lightgbm/examples", "lightgbm/external_libs/fast_double_parser/benchmarks", "lightgbm/external_libs/fmt/doc", "lightgbm/external_libs/fmt/test"] [dependencies] -libc = "0.2.155" +libc = "0.2" [build-dependencies] -cmake = "0.1.50" -bindgen = "0.69.4" -doxygen-rs = "0.4.2" +cmake = "0.1" +bindgen = "0.71" +doxygen-rs = "0.4" [features] openmp = [] diff --git a/lightgbm3-sys/build.rs b/lightgbm3-sys/build.rs index bdc7809..e6af3de 100644 --- a/lightgbm3-sys/build.rs +++ b/lightgbm3-sys/build.rs @@ -47,7 +47,6 @@ fn main() { let mut cfg = Config::new(&lgbm_root); let cfg = cfg .profile("Release") - .uses_cxx11() .cxxflag("-std=c++11") .define("BUILD_STATIC_LIB", "ON"); #[cfg(not(feature = "openmp"))] @@ -59,10 +58,14 @@ fn main() { let dst = cfg.build(); // bindgen build + let mut clang_args = vec!["-x", "c++", "-std=c++11"]; + if target.contains("apple") { + clang_args.push("-mmacosx-version-min=10.12"); + } let bindings = bindgen::Builder::default() .header("lightgbm/include/LightGBM/c_api.h") .allowlist_file("lightgbm/include/LightGBM/c_api.h") - .clang_args(&["-x", "c++", "-std=c++11"]) + .clang_args(&clang_args) .clang_arg(format!("-I{}", lgbm_root.join("include").display())) .parse_callbacks(Box::new(DoxygenCallback)) .generate() diff --git a/lightgbm3-sys/lightgbm b/lightgbm3-sys/lightgbm index 6025283..60b0155 160000 --- a/lightgbm3-sys/lightgbm +++ b/lightgbm3-sys/lightgbm @@ -1 +1 @@ -Subproject commit 602528315c6d5e4ae1e8f5de106cf56cf5869b16 +Subproject commit 60b0155ac573a8ad5994c74c49e05854281e2469 diff --git a/src/dataset.rs b/src/dataset.rs index 2760a4d..e13d560 100644 --- a/src/dataset.rs +++ b/src/dataset.rs @@ -219,7 +219,7 @@ impl Dataset { } // Take label from the dataframe: - let label_series = dataframe.select_series([label_column])?[0].cast(&Float32)?; + let label_series = dataframe.select_columns([label_column])?[0].cast(&Float32)?; if label_series.null_count() != 0 { return Err(Error::new( "Can't create a dataset with null values in label array", @@ -228,7 +228,7 @@ impl Dataset { let _ = dataframe.drop_in_place(label_column)?; let mut label_values = Vec::with_capacity(m); - let label_values_ca = label_series.unpack::()?; + let label_values_ca = label_series.f32()?; label_values.extend(label_values_ca.into_no_null_iter()); let mut feature_values = Vec::with_capacity(m * (n - 1)); @@ -240,7 +240,7 @@ impl Dataset { } let series = series.cast(&Float32)?; - let ca = series.unpack::()?; + let ca = series.f32()?; feature_values.extend(ca.into_no_null_iter()); } Self::from_slice(&feature_values, &label_values, (n - 1) as i32, false)