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 · native missing-value handling (NaN routed to a learned bin, no imputation needed).


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.2.tar.gz (16.6 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.2-cp312-cp312-macosx_11_0_arm64.whl (118.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: oqboost-2.0.2.tar.gz
  • Upload date:
  • Size: 16.6 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.2.tar.gz
Algorithm Hash digest
SHA256 4758c35c0fdea63f9a4058fab33f827a13535d53fb056c4bc43797226772bf27
MD5 2220c1066fc0ae87c03dce8119358989
BLAKE2b-256 f9c1552818712c0e2e040a3343be813f808e372d9d164667de5c22eca0cf4a27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oqboost-2.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74871a12fccdcca0d65d7d4cabdc54c8904010899ecbc4f987b407a48c092ab9
MD5 b2c014f4b4646ce2326f6c90b99b6601
BLAKE2b-256 b76b55171df86fa518ae1f9fed4c7fd194ab8199f711b0068f7c85b5000cd272

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