Skip to content

A batch of updates to get to xgboost 2.0.3 #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
103bc84
Use v1.62
levkk Sep 19, 2022
0575c85
Use Path
levkk Sep 19, 2022
16e0e76
add cuda to the build, upgrade bindgen version and fix some tests
Oct 25, 2022
5b33ede
make cuda a feature
Oct 26, 2022
21e5ae3
re-export feature
Oct 26, 2022
c772eea
update derive
Oct 26, 2022
832979e
it really is 126
Oct 26, 2022
e5a94b4
Expose set_param
levkk Oct 26, 2022
0019487
static link
Oct 26, 2022
50d0533
Just public
levkk Oct 27, 2022
9693f8e
Manually include c++11 paths
levkk May 1, 2023
0544081
diff
levkk May 1, 2023
b2b8af6
fix: can not build in rhel8 centos8
yihong0618 Jul 7, 2023
fd6aedf
XGBoost Mac compile
levkk Jul 20, 2023
65fd5f0
bad commit
levkk Jul 20, 2023
d10eee9
Updated bindgen version to fix build bug
SilasMarvin Sep 19, 2023
9e52e20
checkpoint
montanalow Dec 29, 2023
ad253b4
checkpoint
montanalow Dec 29, 2023
3e536dd
checkpoint
montanalow Dec 29, 2023
e33922d
wut wut
montanalow Dec 29, 2023
247b262
binary
montanalow Dec 29, 2023
60074af
tests pass
montanalow Dec 29, 2023
0307a92
bump version, fix c++ stdlib bindgen (un)support
Apr 29, 2024
ffa1b73
removed upstream dmlc/xgboost/pull/6505
Apr 29, 2024
f81944d
removed upstream dmlc/xgboost/pull/6505
Apr 29, 2024
1da1c03
intel/m1 compatibility
Apr 29, 2024
a11d05d
Merge pull request #11 from postgresml/montana/build
montanalow Apr 29, 2024
767f0ea
Update README.md
montanalow Apr 29, 2024
51e606a
Fix the NaN recall in xgboost training: Update the tag of xgboost to …
cyccbxhl Oct 8, 2024
cc976b2
Tested successfully on MAC as well.
cyccbxhl Oct 8, 2024
747631d
Merge pull request #12 from cyccbxhl/master
montanalow Oct 10, 2024
244d553
Updated to use c++17
SilasMarvin Jan 23, 2025
60e832f
Cleanup
SilasMarvin Jan 23, 2025
07a6a4a
Cleanup
SilasMarvin Jan 23, 2025
0e3d9c7
Merge pull request #13 from postgresml/silas/cxx17
SilasMarvin Jan 23, 2025
d851631
add reqs to README
kczimm Jan 27, 2025
ec745a4
update for 2021 edition
Jan 29, 2025
98604a0
rabit checkpoints removed upstream
Jan 29, 2025
4f0f358
fmt
Jan 29, 2025
fa91b55
Merge pull request #14 from postgresml/montana/build
montanalow Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "xgboost-sys/xgboost"]
path = xgboost-sys/xgboost
url = https://github.com/davechallis/xgboost
branch = master
url = https://github.com/dmlc/xgboost
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, this was originally pointed at a fork to deal with some build issues with the original library involving unused packages. Hopefully it's fixed now though (I'm hazy on the details, but was something to do with the python bindings perhaps...).

12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ homepage = "https://github.com/davechallis/rust-xgboost"
description = "Machine learning using XGBoost"
documentation = "https://docs.rs/xgboost"
readme = "README.md"
edition = "2021"

[dependencies]
xgboost-sys = "0.2.0"
xgboost-sys = { path = "xgboost-sys" }
libc = "0.2"
derive_builder = "0.5"
derive_builder = "0.20"
log = "0.4"
tempfile = "3.0"
indexmap = "1.0"
tempfile = "3.15"
indexmap = "2.7"

[features]
cuda = ["xgboost-sys/cuda"]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

Rust bindings for the [XGBoost](https://xgboost.ai) gradient boosting library.

## Requirements

- Clang v16.0.0

## Documentation

* [Documentation](https://docs.rs/xgboost)

Basic usage example:
Expand Down Expand Up @@ -81,7 +87,7 @@ more detailed examples of different features.
Currently in a very early stage of development, so the API is changing as usability issues occur,
or new features are supported.

Builds against XGBoost 0.81.
Builds against XGBoost 2.0.3.

### Platforms

Expand Down
10 changes: 5 additions & 5 deletions examples/basic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ fn main() {

// load train and test matrices from text files (in LibSVM format).
println!("Loading train and test matrices...");
let dtrain = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.train").unwrap();
let dtrain = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"#).unwrap();
println!("Train matrix: {}x{}", dtrain.num_rows(), dtrain.num_cols());
let dtest = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.test").unwrap();
let dtest = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"#).unwrap();
println!("Test matrix: {}x{}", dtest.num_rows(), dtest.num_cols());

// configure objectives, metrics, etc.
Expand Down Expand Up @@ -66,15 +66,15 @@ fn main() {

// save and load model file
println!("\nSaving and loading Booster model...");
booster.save("xgb.model").unwrap();
let booster = Booster::load("xgb.model").unwrap();
booster.save("xgb.json").unwrap();
let booster = Booster::load("xgb.json").unwrap();
let preds2 = booster.predict(&dtest).unwrap();
assert_eq!(preds, preds2);

// save and load data matrix file
println!("\nSaving and loading matrix data...");
dtest.save("test.dmat").unwrap();
let dtest2 = DMatrix::load("test.dmat").unwrap();
let dtest2 = DMatrix::load_binary("test.dmat").unwrap();
assert_eq!(booster.predict(&dtest2).unwrap(), preds);

// error handling example
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_objective/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use xgboost::{parameters, DMatrix, Booster};
fn main() {
// load train and test matrices from text files (in LibSVM format)
println!("Custom objective example...");
let dtrain = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.train").unwrap();
let dtest = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.test").unwrap();
let dtrain = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"#).unwrap();
let dtest = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"#).unwrap();

// specify datasets to evaluate against during training
let evaluation_sets = [(&dtest, "test"), (&dtrain, "train")];
Expand Down
4 changes: 2 additions & 2 deletions examples/generalised_linear_model/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ fn main() {

// load train and test matrices from text files (in LibSVM format)
println!("Custom objective example...");
let dtrain = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.train").unwrap();
let dtest = DMatrix::load("../../xgboost-sys/xgboost/demo/data/agaricus.txt.test").unwrap();
let dtrain = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.train?format=libsvm"}"#).unwrap();
let dtest = DMatrix::load(r#"{"uri": "../../xgboost-sys/xgboost/demo/data/agaricus.txt.test?format=libsvm"}"#).unwrap();

// configure objectives, metrics, etc.
let learning_params = parameters::learning::LearningTaskParametersBuilder::default()
Expand Down
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_width = 120
single_line_if_else_max_width = 80
Loading