> ## 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
```

## `AutoHurdleRegressor`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L38)

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**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `classifier` | `Any` | `None` | Cloneable classifier with predict\_proba. Defaults to TabPFN. |
| `regressor` | `Any` | `None` | Cloneable regressor with TabPFN's output\_type and quantiles prediction arguments. Defaults to TabPFN. |
| `hurdle` | `Literal["auto"] \| bool` | `"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. |
| `zero_threshold` | `float` | `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. |
| `quantile_grid` | `list[float] \| tuple[float, ...] \| np.ndarray \| None` | `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. |

***

## `AutoHurdleRegressor.fit`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L82)

Fit cloned estimators, preserving DataFrame columns and dtypes.

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

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `X` | `Any` | Required | — |
| `y` | `Any` | Required | — |

**Returns**

| Type | Description |
| - | - |
| `AutoHurdleRegressor` | — |

***

## `AutoHurdleRegressor.predict`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/hurdle/hurdle.py#L145)

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**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `X` | `Any` | Required | — |
| `output_type` | `Literal["mean", "median", "quantiles"]` | `"median"` | — |
| `quantiles` | `list[float] \| None` | `None` | — |

**Returns**

| Type | Description |
| - | - |
| `np.ndarray \| list[np.ndarray]` | — |


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