Skip to main content

BisectionRegressor

A scikit-learn-compatible regressor that predicts continuous targets by recursively bisecting the target's value range, using a binary classifier at each node to decide which half a sample falls into. Predictions are formed by softly blending both branches at every node, weighted by the classifier's confidence (via the law of total expectation), rather than committing to a single hard path.

Works as a drop-in scikit-learn estimator: Pipeline, GridSearchCV, cross_val_score, clone, sample_weight are all supported.

Install

From PyPI:

pip install bisection-regressor

From source, for development:

git clone https://github.com/vihan015/bisection-regressor.git
cd bisection-regressor
pip install -e .

To also run the benchmarks (needs pandas):

pip install -e ".[benchmarks]"

Quick start

from sklearn.datasets import load_diabetes
from sklearn.model_selection import train_test_split
from bisection_regressor import BisectionRegressor

X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=0)

reg = BisectionRegressor(max_depth=6)
reg.fit(X_train, y_train)
print(reg.score(X_test, y_test))   # R^2

Documentation

  • docs/hyperparameters.md: every hyperparameter explained, plus usage examples covering Pipeline, GridSearchCV (including BisectionForestRegressor's nested params), cross-validation, sample weights, and tree inspection.
  • docs/math_deepdive.md: a from-scratch walkthrough of exactly what fit() and predict() compute internally, and every mathematical concept involved (medians, entropy, the law of total expectation, empirical Bayes shrinkage, probability calibration, bagging), with a fully worked, verified numeric example.

Results

See paper/report.md for the full write-up: how the method was diagnosed and improved from an initial naive design, the mathematical justification for each fix, and 5-fold cross-validated results on three real UCI datasets (Wine Quality, Concrete Compressive Strength, Auto MPG) against standard baselines (Linear Regression, Random Forest, Gradient Boosting, and so on), reported honestly, including where the method does not win.

Reproduce the benchmark yourself: see benchmarks/.

Status

This is a research/experimental estimator, not a production-hardened replacement for gradient boosting or random forests. It's a specific, interpretable structural alternative. See paper/report.md for exactly where it's competitive and where it isn't.

License

MIT. See LICENSE.

Metadata

Release files for bisection-regressor 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bisection-regressor 0.3.0
File Size Uploaded Provenance Actions
bisection_regressor-0.3.0.tar.gz 18.4 kB Without provenance Details for bisection_regressor-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bisection-regressor 0.3.0
File Interpreter ABI Platform Actions
bisection_regressor-0.3.0-py3-none-any.whl Python 3 none any Details for bisection_regressor-0.3.0-py3-none-any.whl

Total release size: 35.3 kB

Release files / bisection_regressor-0.3.0.tar.gz

Download URL bisection_regressor-0.3.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
62a2b1d2b3a686cb06eba049fbf3786c77e14978e510644349b453c653b6b968
BLAKE2b-256 checksum
How to use checksums
70a25a07bf9454bdf4ee3e1438c0b8983a397231fc05bf5d25e71b96332454ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / bisection_regressor-0.3.0-py3-none-any.whl

Download URL bisection_regressor-0.3.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7e18a1ab748b9b3e0f19ff7fba7cefd9487e927bcc6dae9287aaef8813c875b
BLAKE2b-256 checksum
How to use checksums
6fbb4e92dc3221f8dbda024d681c23e3a7b0cc24fc8689184bb94943fa53fe71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for bisection-regressor 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page