Skip to main content

OQBoost 2.0 — gradient-boosted 2D-oblique decision trees (histogram-binned, C++ backend)

Project description

OQBoost 2.0

Gradient-boosted 2D-oblique decision trees — histogram-binned, C++ backend.

OQBoost splits on oblique hyperplanes over feature pairs (a·u + b·v < t) instead of axis-aligned thresholds, capturing diagonal and interaction boundaries that XGBoost/LightGBM approximate with coarse staircases. Version 2.0 is a ground-up redesign: a histogram-binned 2D-oblique core with a deterministic direction fit.

scikit-learn compatible · compiled C++ (pybind11) + OpenMP.


Install

pip install oqboost

A prebuilt wheel is provided for macOS (arm64, CPython 3.12). On other platforms pip builds from source — needs a C++17 compiler (clang++/g++) and, for parallelism, OpenMP (brew install libomp on macOS).

Quickstart

from oqboost import OQBoostClassifier, OQBoostRegressor

# Binary classification
clf = OQBoostClassifier(
    n_estimators=120, learning_rate=0.06, max_depth=4,
    max_bins=16, subsample=0.8, colsample=0.8, random_state=42,
)
clf.fit(X_train, y_train)
proba = clf.predict_proba(X_test)[:, 1]   # P(class 1)
pred  = clf.predict(X_test)

# Regression (squared error)
reg = OQBoostRegressor(n_estimators=120, learning_rate=0.06)
reg.fit(X_train, y_train)
y_hat = reg.predict(X_test)

Both are drop-in scikit-learn estimators — usable in Pipeline, GridSearchCV, cross_val_score, and clone.

Key hyperparameters

Param Default Meaning
n_estimators 120 boosting rounds
learning_rate 0.06 shrinkage
max_depth 4 interaction depth (stacked 2D cuts)
max_bins 16 grid / direction-seed resolution (keep small)
subsample 0.8 rows per tree (key overfit lever)
colsample 0.8 features per node
reg_lambda 1.0 L2 regularization
n_screen -1 SIS top-m feature screening (-1 = exhaustive)

Why oblique

Axis-aligned boosters need many stacked cuts to approximate a diagonal boundary. On a 2D XOR problem XGBoost reaches only AUC ≈ 0.53 while OQBoost reaches ≈ 0.92; on a Spiral OQBoost draws the smoothest boundary of all four boosters. Across tuned benchmarks it ranks above XGBoost and LightGBM.

Full benchmarks, decision-boundary figures, and design notes: https://github.com/cree1116/oqboost-2.0

Note: OQBoost 2.0 is a ground-up rewrite. The original 1.x line — oblique splits via a Deterministic Gradient-Covariance Scan (DGCS) — lives at cree1116/OQBoost. 2.0 replaces the direction finder with a histogram-binned BHC-seeded least-squares fit.


MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oqboost-2.0.1.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oqboost-2.0.1-cp312-cp312-macosx_11_0_arm64.whl (114.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file oqboost-2.0.1.tar.gz.

File metadata

  • Download URL: oqboost-2.0.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for oqboost-2.0.1.tar.gz
Algorithm Hash digest
SHA256 3e1bdfbf0bbc5e9de7bf78596f9dd7cf39d09bb91dd2ecb2af450214ea706392
MD5 4215817457066f0bcbeac836a6221b84
BLAKE2b-256 9451183e6e6d723285d2a39c39d33613f192294d0a1b0821fbd7961d072cd087

See more details on using hashes here.

File details

Details for the file oqboost-2.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for oqboost-2.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4aedf5bed0189849bc3843b52b5e1c9642317f0688c13860ac68047ad8e80538
MD5 9f913b8bf7f2f51fd925a11afa46fde5
BLAKE2b-256 cbf8859bad64cf023a42e340b3924b5dcb34b63f26968c461dea14ed8793d4ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page