SnapBoost Documentation
SnapBoost is an instance of a Heterogeneous Newton Boosting Machine (HNBM) — a generalized gradient boosting framework that supports the use of various types of learners aside from trees. Snapboost is an HNBM that mixes decision trees and kernel ridge regressors instead of trees alone. SnapBoost is scikit-learn compatible and built on HNBM.
At each boosting round, SnapBoost stochastically selects either a decision tree or an RFF ridge regressor. That mix captures both local, axis-aligned structure and smooth global patterns.
New in 1.2.0
Native multiclass classification via HNBM softmax Newton boosting: one scalar learner per class each round,
predict_probaof shape(n_samples, n_classes), andn_classes_on the fitted estimator.Binary logistic classification is unchanged (scalar
decision_function).Requires HNBM 1.2.0 or newer.
New in 1.1.0
Staged prediction (
staged_predict,staged_predict_proba,staged_decision_function) andpermutation_importance.Original-label
eval_metricandeval_sample_weightfor validation loss and early stopping.gamma="scale"(sklearn variance-based kernel coefficient) andalpha_linearfor the optional linear family.Requires HNBM 1.1 or newer.
New in 1.0.0
Frozen
SnapBoostClassifier/SnapBoostRegressorpublic API.sklearn estimator tags and
check_estimatorcoverage via HNBM 1.0.Parameter validation at
fit, matching the sklearn contract.SnapBoost(mode=...)andSnapBoost_KernelRidgeare deprecated.
See limitations for the dense-input and CART-tree contract. Classification supports binary logistic loss and multiclass softmax.
Key properties:
Scikit-learn API (
fit/predict/score)Classification and regression estimators
Heterogeneous base learners (trees + RFF ridge)
Built on the HNBM framework
Inspired by SnapBoost: A Heterogeneous Boosting Machine (Parnell et al., NeurIPS 2020).
pip install snapboost
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from snapboost import SnapBoostClassifier
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)
model = SnapBoostClassifier(num_iterations=100, learning_rate=0.1, random_state=42)
model.fit(X_train, y_train)
print("Accuracy:", model.score(X_test, y_test))