Skip to content

v1.2.0 — wheels, reusable Dataset, classifier fixes

Choose a tag to compare

@daniel-m-campos daniel-m-campos released this 14 Jul 01:00

Install without a toolchain, reuse binning across fits, and a round of classifier correctness fixes surfaced by an adversarial post-release review.

Prebuilt wheels are attached below — Linux x86_64/aarch64 (manylinux_2_35, Ubuntu 22.04+/Debian 12+) and macOS arm64, Python 3.9–3.13. pip install the wheel for your platform; no LLVM/CMake needed. CPU-only — GPU training remains a source build.

Added

  • Python 3.9 supportrequires-python lowered to 3.9; full binding suite verified on CPython 3.9.25.
  • Prebuilt wheels on GitHub Releases — libc++ vendored into the wheel, OpenMP statically linked; every wheel smoke-tested in a clean venv (fit, predict_proba, Dataset, save/from_file) before shipping.
  • Reusable pre-binned bonsai.Dataset — bin once, train many: ds = bonsai.Dataset(X, y); bonsai.train(params, ds) skips the per-fit bin pass across a hyperparameter search or CV loop, bit-identical to fitting from (X, y). On GPU the resident-matrix upload-skip cache now fires across fits. Bin settings are sealed at construction — bin_mapper.* overrides are rejected whether they arrive as params or inside a config file.
  • Multiclass predict_proba(n, K) row-wise softmax probabilities; completes BonsaiClassifier.
  • xgboost/lightgbm-style constructor aliases on both estimators: n_estimators, num_leaves, random_state, n_jobs, reg_lambda, reg_alpha, max_bin, min_child_samples, colsample_bytree.
  • Model.objective_name / Model.n_classes read-only properties.

Fixed

  • Multiclass sample_weight was silently ignored — the softmax gradient/hessian loop never applied per-row weights; a weighted 3-class fit was bit-identical to unweighted. Weights now scale grad/hess; unweighted fits are unchanged bit-for-bit.
  • BonsaiClassifier.from_file crashed predict/predict_proba — class metadata was only set by fit. Restored from the saved model as encoded ids 0..K-1 (xgboost's load_model convention; pickle preserves original label values), and non-classifier models are rejected instead of mislabeled.
  • eval_set labels absent from the training classes now raise instead of silently corrupting the validation metric and early stopping. NaN labels are rejected like sklearn.

Docs

  • README: superseded benchmark content removed; stale facts corrected.

Full details in CHANGELOG.md.

https://claude.ai/code/session_01SfgWZ7ftZV7aJJh87NXR72