> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priorlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# Hurdle regression

> Two-stage regression for non-negative targets with a point mass at zero.

## Installation

```bash theme={null}
pip install tabpfn-extensions
```

<div className="python-reference-heading">
  <h2 id="hurdle-hurdle-autohurdleregressor">
    `AutoHurdleRegressor`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L38" aria-label="View source for AutoHurdleRegressor"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Two-stage regression for non-negative targets with a point mass at zero.

predict defaults to the mixture median, suitable for absolute error. With
positive probability p, it is zero for p \<= 0.5 and otherwise the positive
distribution's (p - 0.5) / p quantile. Quantiles use linear interpolation on
the supplied grid, clamping levels outside that grid. Negative
positive-stage predictions are clipped to zero. Mean predictions multiply
the clipped positive-stage mean by p.

Fitted attributes include hurdle\_, zero\_rate\_, classifier\_, and regressor\_.
classifier\_ is `None` when the hurdle is inactive. Both estimators are `None`
for an all-zero target with the hurdle enabled.

```python theme={null}
AutoHurdleRegressor(
    classifier: Any = None,
    regressor: Any = None,
    *,
    hurdle: Literal["auto"] | bool = "auto",
    zero_threshold: float = 0.25,
    quantile_grid: list[float] | tuple[float, ...] | np.ndarray | None = None,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="hurdle-hurdle-autohurdleregressor--classifier" /><code className="python-reference-parameter">classifier</code> | <code className="python-reference-type">Any</code> | `None` | Cloneable classifier with predict\_proba. Defaults to TabPFN. |
  | <span id="hurdle-hurdle-autohurdleregressor--regressor" /><code className="python-reference-parameter">regressor</code> | <code className="python-reference-type">Any</code> | `None` | Cloneable regressor with TabPFN's output\_type and quantiles prediction arguments. Defaults to TabPFN. |
  | <span id="hurdle-hurdle-autohurdleregressor--hurdle" /><code className="python-reference-parameter">hurdle</code> | <code className="python-reference-type">Literal\["auto"] \| bool</code> | `"auto"` | Whether to split zero and positive targets. "auto" enables the split for non-negative targets whose zero rate exceeds `zero_threshold`. Otherwise, all rows go to the regressor. |
  | <span id="hurdle-hurdle-autohurdleregressor--zero-threshold" /><code className="python-reference-parameter">zero\_<wbr />threshold</code> | <code className="python-reference-type">float</code> | `0.25` | Training zero-rate threshold for automatic selection. Defaults to `0.25`, a heuristic rather than a tuned optimum. This controls whether to fit two stages, independently of the prediction statistic. |
  | <span id="hurdle-hurdle-autohurdleregressor--quantile-grid" /><code className="python-reference-parameter">quantile\_<wbr />grid</code> | <code className="python-reference-type">list\[float] \| tuple\[float, ...] \| <a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html">np.ndarray</a> \| None</code> | `None` | Strictly increasing positive-stage quantile levels between 0 and 1, with at least two entries. `None` uses the 21-point grid from 0.01 to 0.99. Required levels outside the grid clamp to its endpoints. |
</div>

***

<div className="python-reference-heading">
  <h2 id="hurdle-hurdle-autohurdleregressor-fit">
    `AutoHurdleRegressor.fit`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L82" aria-label="View source for AutoHurdleRegressor.fit"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Fit cloned estimators, preserving DataFrame columns and dtypes.

```python theme={null}
AutoHurdleRegressor.fit(
    X: Any,
    y: Any,
) -> AutoHurdleRegressor
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="hurdle-hurdle-autohurdleregressor-fit--x" /><code className="python-reference-parameter">X</code> | <code className="python-reference-type">Any</code> | Required | — |
  | <span id="hurdle-hurdle-autohurdleregressor-fit--y" /><code className="python-reference-parameter">y</code> | <code className="python-reference-type">Any</code> | Required | — |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-extensions/hurdle#hurdle-hurdle-autohurdleregressor">Auto<wbr />Hurdle<wbr />Regressor</a></code> | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="hurdle-hurdle-autohurdleregressor-predict">
    `AutoHurdleRegressor.predict`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L145" aria-label="View source for AutoHurdleRegressor.predict"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Predict a mean, median, or list of quantile arrays in target units.

```python theme={null}
AutoHurdleRegressor.predict(
    X: Any,
    *,
    output_type: Literal["mean", "median", "quantiles"] = "median",
    quantiles: list[float] | None = None,
) -> np.ndarray | list[np.ndarray]
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="hurdle-hurdle-autohurdleregressor-predict--x" /><code className="python-reference-parameter">X</code> | <code className="python-reference-type">Any</code> | Required | — |
  | <span id="hurdle-hurdle-autohurdleregressor-predict--output-type" /><code className="python-reference-parameter">output\_<wbr />type</code> | <code className="python-reference-type">Literal\["mean", "median", "quantiles"]</code> | `"median"` | — |
  | <span id="hurdle-hurdle-autohurdleregressor-predict--quantiles" /><code className="python-reference-parameter">quantiles</code> | <code className="python-reference-type">list\[float] \| None</code> | `None` | — |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type"><a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html">np.ndarray</a> \| list\[<a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html">np.ndarray</a>]</code> | — |
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.