v1.2.0 — wheels, reusable Dataset, classifier fixes
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 support —
requires-pythonlowered 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; completesBonsaiClassifier. - 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_classesread-only properties.
Fixed
- Multiclass
sample_weightwas 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_filecrashedpredict/predict_proba— class metadata was only set byfit. Restored from the saved model as encoded ids0..K-1(xgboost'sload_modelconvention; pickle preserves original label values), and non-classifier models are rejected instead of mislabeled.eval_setlabels 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.