dmlc / XGBoost.jl

XGBoost Julia Package
Other
288 stars 111 forks source link

update to libxgboost 2.0 #191

Closed ExpandingMan closed 10 months ago

ExpandingMan commented 10 months ago

This updates to libxgboost version 2.0 thanks to @tylerjthomas9 update of the JLL.

Surprisingly little seems to have changed (at least as far as breaking changes in the interface are concerned). The only real difference seems to be in model and DMatrix inputs and outputs, which appear to have been sanitized somewhat. libxgboost now requires the format of a file from which a dmatrix is loaded to be explicitly specified. Unfortunately, in order for this not to cause a breaking change, we have to default this format to libsvm. This is undesirable because save exports a different file format, which libxgboost does not name which I am calling :binary. I badly wanted to change this, but I can't justify breaking it. Furthermore, saving boosters in a binary format using SaveModel seems to be deprecated (according to warnings, it's not documented in the API). I have changed this default behavior, but I feel this is safer since the model load function reads JSON by default in both versions, so at least within XGBoost.jl this is an improvement.

Note that I have dropped support for libxgboost 1 in this version. This makes things far simpler (primarily because the C calls have changed slightly) and I don't see any particularly compelling reasons why this should support older versions of libxgboost, users who want to do that can simply use XGBoost.jl 2.3 and they won't be missing much.

Alternatively, we could release a lightly breaking 3.0 wrapper in which we can clean up these file options once and for-all and make a few other small sanitization changes, however that seems very hard to justify for a package this widely used, I tried to do what I thought would make the largest number of people happy.