package xgboost
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
OCaml bindings for the XGBoost gradient boosting library
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.2.1.tar.gz
md5=df39458954596436cba315813cede5fa
sha512=3acac1b835b9bbc4c96bfd5c2483d783800d33da1708436f78c6d7629bd0f8add6f7b021ec87392f3226971001e66b126855fc19251fa6ca4ca743fbd80ad12f
doc/CHANGES.html
Changelog
0.2.1 (2026-08-21)
- Fix the build against libxgboost >= 3.1: drop a stray, unused binding to
XGDMatrixCreateFromCSREx, which was removed from the C API after 3.0 and broke ctypes stub compilation on newer libxgboost (e.g. Homebrew's 3.4.1). The sparse-CSR path already uses the modernXGDMatrixCreateFromCSR.
0.2.0 (2026-08-20)
First opam release.
- Native dependency is now hybrid: the build links a system libxgboost ≥ 3.0 when
pkg-configfinds one (installed via opamdepextson platforms that package it), and otherwise compiles a pinned, vendored copy of XGBoost from source (bundled undervendor/xgboost, CMake, static link, no network required). This letsopam install xgboostwork on any platform, including those without a distro package. Xgboost.Eval— parseeval_one_itermetric strings; compute AUC and ROC directly from prediction/label Bigarrays.Xgboost.Cv.k_fold— k-fold cross validation with optional group-coherent splitting (?group_ids) andsummarise.Xgboost.DMatrix.slice— row-subset a DMatrix.
0.1.0
Initial release. Native OCaml bindings to libxgboost ≥ 3.0 covering:
DMatrix construction
- dense (Bigarray.Array2 of float32, zero-copy via the modern
XGDMatrixCreateFromDensearray_interface path) - sparse CSR (modern
XGDMatrixCreateFromCSR) - streaming iterator (
DMatrix.of_iterator) backed byXGProxyDMatrixCreate+XGDMatrixCreateFromCallback, with optional external-memory caching viacache_prefix
- dense (Bigarray.Array2 of float32, zero-copy via the modern
Booster lifecycle, training, prediction
update_one_iter,boost_one_iter(custom gradient/hessian),eval_one_iter,resetpredict(eager copy),predict_dense(in-place from Bigarray),Unsafe.predict_borrowed(no-copy expert variant)feature_scorewith selectable importance type
- Persistence: model save/load via path or buffer; JSON config save/load
- GC-safe lifetime model:
Gc.finalise_lastd handles, scoped combinators (with_), idempotentfree - Comprehensive test suite (alcotest + qcheck), cross-layer fixture parity oracle, clean run under AddressSanitizer
- Benchmarks against pure-C reference and Python xgboost on a fixed workload grid; see BENCH.md
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page