Skip to content

Add automatic hurdle regression - #395

Open
adrian-prior wants to merge 3 commits into
mainfrom
adrian/hurdle_regressor
Open

Add automatic hurdle regression#395
adrian-prior wants to merge 3 commits into
mainfrom
adrian/hurdle_regressor

Conversation

@adrian-prior

@adrian-prior adrian-prior commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Generated by Codex

Add AutoHurdleRegressor for regression targets with a point mass at zero. It fits a zero/nonzero classifier and a regressor on positive rows, then combines their predictions into means, medians, or quantiles. A runnable Facebook Comment Volume example compares means with RMSE first, then medians with MAE, against plain TabPFN and constant baselines.

Automatic selection uses a configurable training zero-rate threshold. Supplied estimators and the interpolation grid are configurable; the default prediction is the mixture median, using a 21-point grid from 0.01 to 0.99. All-zero targets predict zero without fitting either stage, and signed targets use ordinary regression in automatic mode.

Validation: all 32 hurdle tests passed with local TabPFN 8.4.0, including a real-model integration test. Repository Ruff lint/format checks and pinned pre-commit hooks passed.

Example command and captured output

The example samples 1,000 training rows and 1,000 test rows separately from the published splits, using seed 0. Results depend on the sample and model version.

python examples/hurdle/facebook_comments.py --n-train 1000 --n-test 1000 --seed 0
Rows: 1000 train, 1000 test
Zero targets: 52.7% train, 34.9% test
Hurdle enabled: True
Constant mean        RMSE: 121.6932
TabPFN mean          RMSE: 102.2148
Hurdle mean          RMSE: 98.3218
Constant median      MAE: 32.1650
TabPFN median        MAE: 25.3989
Hurdle median        MAE: 24.8174

Data: Singh, K. (2015), Facebook Comment Volume, CC BY 4.0.

@adrian-prior
adrian-prior added this pull request to stack #397 September 11, 2026 15:10
@adrian-prior
adrian-prior marked this pull request as ready for review September 11, 2026 15:14
@adrian-prior
adrian-prior removed this pull request from stack #397 September 11, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant