Skip to content

Releases: brndnmtthws/hessboost

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 29 Sep 02:06
Immutable release. Only release title and notes can be modified.
v0.2.2
4830610

hessboost v0.2.2

Patch release: the Python bindings gain target statistics, budget training, and compact models, and approximate online updates get two correctness fixes. No breaking changes.

Full Changelog: v0.2.1...v0.2.2

Highlights Since v0.2.1

Python bindings

  • hessboost.target_stats: OrderedTargetEncoder / FittedTargetEncoder (fit by column index or name, optional separate label=), with unseen categories encoding to the prior while real nulls stay missing.
  • hessboost.train_with_budget(params, dtrain, budget=...) returns a Booster.
  • hessboost.cv(..., target_stats=..., target_encoder=...) fits the encoder on each fold's training rows only; ranking data cross-validates with whole-query folds.
  • Booster.to_compact() returns a CompactModel with bit-identical predictions (save/load, pickling, feature schema preserved); Booster.size_report() reports compression ratio and reuse factor; new metadata num_trees(), num_outputs, num_targets, num_parallel_tree, base_margins, vector_leaves.

Rust

  • DMatrix::select_rows keeps whole query groups (repeated or omitted groups allowed); a selection that splits, reorders, or interleaves a group is refused instead of silently dropping the groups. CrossValidation::run applies the same check to every fold before training.
  • OrderedTargetEncoder::fit_transform_with_labels fits on a separate per-row target without relabeling the matrix; CrossValidation::target_stats(encoder, columns) encodes each fold's test rows from its training rows.
  • Approximate online mode: OnlineModel::from_model refuses models whose first-tree leaves are not the params' Newton steps on the data (e.g. LightGBM imports, other eta); refreshed margins now follow prediction's fold order, fixing wrong residuals at large intercepts.

Behavior change: code that sliced ranking data mid-group used to get an ungrouped matrix; it now gets an InvalidParameter error.

Bug fixes

  • CompactModel.save no longer holds the GIL while copying the serialized model.
  • An all-null pandas categorical no longer crashes frame re-coding with IndexError.

Pull Requests by Category

Features

  • feat(python): target statistics, budget training, compact models; keep query groups in select_rows (#136)

Bug Fixes

  • fix(online): refuse non-Newton first-tree leaves on approximate resume; refresh margins in prediction order (#135)
  • fix(python): encode CompactModel bytes without the GIL (#137)

Misc

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 29 Sep 00:19
Immutable release. Only release title and notes can be modified.
cbcb443

hessboost 0.2.1

Small feature release on top of 0.2.0: polars input and Metal GPU prediction in Python, plus a faster bit-identical Metal backend and compiled-in models in Rust.

Full Changelog: v0.2.0...v0.2.1

Breaking Changes

None.

Highlights Since v0.2.0

Python

  • polars DataFrames accepted directly, including Categorical and Enum columns (hessboost[polars] extra). Column names become feature names, so schema checks catch reordered columns; unseen categories at prediction are missing.
  • Booster.to_gpu(): Metal GPU batch prediction on macOS, bit-identical to the CPU walk (~1.68x at 500k rows x 200 depth-8 trees on an M3 Max). Off macOS it raises HessboostError; only value/margin prediction is exposed.

Rust / Metal backend

  • model::EmbeddedModel: compile a model file into the binary via include_bytes!, decoded once on first get() (Rust only). Failed decodes are not cached; every call returns the error.
  • Metal backend rewrite, still bit-identical to the CPU: atomic-scatter GPU histograms (exact 32-bit pieces) plus an 8-byte prediction arena with pipelined row blocks. GPU prediction is now ~3.2x the CPU walk (was ~2.5x); GPU histograms cross the CPU between ~1M and ~4M rows per node, and small-dataset training still belongs on the CPU.

Docs

  • Python README rewritten as per-feature examples; GPU guidance (CUDA unavailable; Metal for macOS prediction / large-node histograms).

Pull Requests by Category

Features

  • polars DataFrame input with categorical columns (#128)
  • expose Metal GPU prediction via Booster.to_gpu (#130)
  • scatter GPU histograms and pipeline prediction (#131)
  • EmbeddedModel for models compiled into the binary (#132)

Misc

Install

cargo add hessboost@0.2
pip install hessboost==0.2.1

Start with the README,
the Rust docs, and the Python package README.

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 27 Sep 20:34
Immutable release. Only release title and notes can be modified.
0507f5a

hessboost 0.2.0 — first stable release

The earlier 0.1.x tags were publishing test runs. Treat 0.2.0 as the first
real release.

hessboost is fast, deterministic gradient boosting in Rust (with Python
bindings): multi-core tree building with NEON/AVX2 SIMD, strict parameter
validation, reproducible models on any thread count, and stable model
storage — plus conformal prediction, explainable boosting machines,
distributional modeling, tree-based diffusion, and XGBoost JSON/UBJSON
model interchange.

Install:

cargo add hessboost@0.2
pip install hessboost

Start with the README,
the Rust docs, and the Python package README.

hessboost 0.1.1

Choose a tag to compare

@github-actions github-actions released this 23 Sep 18:25
Immutable release. Only release title and notes can be modified.
1af4e21

hessboost is a pure-Rust reimplementation of XGBoost gradient boosting: no C/C++ dependency and no FFI. Objective, metric, and parameter names mirror XGBoost, so configurations carry over directly.

This is the first supported release; 0.1.0 is yanked.

[dependencies]
hessboost = "0.1.1"
use hessboost::prelude::*;

let dtrain = DMatrix::from_dense(&x, n_rows, n_cols)?.with_labels(&y)?;
let params = TrainingParams::builder()
    .objective("binary:logistic")
    .max_depth(6)
    .eta(0.1)
    .build()?;
let model = train(&params, &dtrain, 100)?;
let probabilities = model.predict(&dtrain)?;

Features

  • Boosters: gbtree, dart, and gblinear.
  • Tree construction: exact, hist, and approx tree methods; depthwise and lossguide growth; sparsity-aware missing values; row and column subsampling (bytree, bylevel, bynode).
  • Objectives: reg:squarederror (alias reg:linear), reg:logistic, reg:pseudohubererror, reg:gamma, reg:tweedie, count:poisson, binary:logistic, multi:softmax, multi:softprob, rank:pairwise, rank:ndcg, rank:map, plus custom objectives (train_with_objective). Intercepts are estimated per output the same way XGBoost 3.4.1 does.
  • Metrics: rmse, mae, logloss, error, auc, aucpr, mlogloss, merror, ndcg, map (with @k), poisson-nloglik, gamma-nloglik, tweedie-nloglik, plus custom metrics (train_with_custom_metric).
  • Modeling: monotone and interaction constraints (in both hist and exact), native categorical splits, per-row base_margin, early stopping, k-fold cv, feature importance (weight, gain, cover, and totals), and leaf-index prediction.
  • Explainability: TreeSHAP contributions (predict_contribs) and interaction values (predict_interactions).
  • I/O: libsvm and CSV loaders; native binary and JSON models; XGBoost JSON model import and export for numeric gbtree ensembles.

Performance

Runtime-detected SIMD kernels (NEON on AArch64; AVX2/FMA and SSE2 on x86-64) handle gradients, prediction transforms, metrics, and quantile binning. Histogram training runs in parallel with rayon. Other CPUs, and inputs outside the vector paths, use scalar code.

Against XGBoost 3.4.1 on an Apple M3 Max (CPU hist, 100 rounds, depth 6, 256 bins), hessboost had a lower median fit time in all 12 measured configurations:

Threads Speedup
1 2.28–2.77×
4 1.82–2.20×
16 1.37–1.63×

Held-out quality matches XGBoost closely. See docs/performance.md for the workloads, method, and kernel benchmarks.

XGBoost parity

CI checks every commit against real XGBoost 3.4.1 using 37 fixture cases that cover each objective, the tree methods, missing values, constraints, weights, ranking groups, categorical splits, DART, and gblinear. Each case is checked three ways:

  • Train: same data and parameters, comparing predictions.
  • Import: load the XGBoost model and compare predictions, margins, and SHAP contributions.
  • Export: XGBoost reloads the model hessboost wrote.

Deterministic cases must agree pointwise (1e-4 to 1e-5). Subsampling and DART cases use an accuracy band, because the two libraries' random number generators differ. Histogram and approximate quantile cuts match XGBoost bit for bit.

API notes

  • use hessboost::prelude::* brings in the full training and prediction API. The crate root exports only modules; everything else is reached through its module (for example, hessboost::tree::RegTree and hessboost::data::load_csv).
  • train_with_objective takes &dyn Objective.
  • Every fallible call returns hessboost::prelude::Result (HessboostError).
  • Identical parameters, data, and seed give identical predictions.

Requirements

  • Rust 1.93 or newer (edition 2024).
  • CI tests on x86_64 Linux, aarch64 Linux, and aarch64 macOS.

Not implemented

UBJSON (binary) XGBoost models, XGBoost JSON for gblinear models, GPU training, distributed or external-memory training, and Python/CLI/C-ABI bindings.

Caveats

The code was generated with Claude (Anthropic) under human direction and review. It has unit, property, and doc tests, and CI checks parity with XGBoost, but it may still contain bugs or numerical edge cases. Validate it for your use case.

hessboost is a fork of sequoia-boost (Copyright 2026 Patrick Garrett, Apache-2.0). It is an independent reimplementation of XGBoost (Copyright the XGBoost Contributors, Apache-2.0) and is not affiliated with or endorsed by the XGBoost project. Licensed under Apache-2.0.