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

# Constructor and configuration

> Configure the hosted TabPFN regressor.

<Info>
  Looking for usage documentation? Check out [Regression](/capabilities/regression), [Thinking mode](/capabilities/thinking-mode) and [KV cache](/capabilities/kv-cache).
</Info>

<div className="python-reference-heading">
  <h2 id="constructor">
    `TabPFNRegressor`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-client/blob/5f8aee56ad2a788458704c342347e9bc282cebe9/src/tabpfn_client/estimator.py#L644" aria-label="View source for TabPFNRegressor"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

Hosted TabPFN regressor with a scikit-learn-compatible interface.

Construct a TabPFN regressor.

This constructs a regressor using the latest model and settings. If you would
like to use a previous model version, use [`create_default_for_version()`](/api-reference/python/tabpfn-client/regressor/model-selection-and-persistence#create-default-for-version)
instead. You can also use `model_path` to specify a particular model.

```python theme={null}
TabPFNRegressor(
    model_path: str | None = None,
    n_estimators: int | None = None,
    softmax_temperature: float | None = None,
    average_before_softmax: bool | None = None,
    ignore_pretraining_limits: bool = False,
    inference_precision: Literal["autocast", "auto"] | None = None,
    random_state: int | None = 0,
    inference_config: dict[str, Any] | None = None,
    categorical_features_indices: list[int] | None = None,
    fit_mode: FitModeLiteral | None = None,
    paper_version: bool = False,
    thinking_mode: bool = False,
    thinking_effort: ThinkingEffort | None = None,
    thinking_timeout_s: float | None = None,
    thinking_metric: str | None = None,
    group_col: str | list[str] | None = None,
    time_col: str | None = None,
    group_time_col: str | None = None,
    api_mode: ApiMode = ApiMode.AUTO,
    client_options: ClientOptions | None = None,
    text_handling: TextHandling = "advanced",
)
```

<Accordion title="Type aliases">
  ```python theme={null}
  TextHandling = Literal["advanced", "simple"]
  ```
</Accordion>

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="constructor-model-path" /><code className="python-reference-parameter">model\_<wbr />path</code> | <code className="python-reference-type">str \| None</code> | `None` | The name of the model to use. "auto" (or `None`) lets the server pick the latest default model; "default" is accepted as a backward-compatible alias. Use [`create_default_for_version()`](/api-reference/python/tabpfn-client/regressor/model-selection-and-persistence#create-default-for-version) to pin to a specific major version, and [`list_available_models()`](/api-reference/python/tabpfn-client/regressor/model-selection-and-persistence#list-available-models) for the accepted names. |
  | <span id="constructor-n-estimators" /><code className="python-reference-parameter">n\_<wbr />estimators</code> | <code className="python-reference-type">int \| None</code> | `None` | The number of estimators in the TabPFN ensemble. We aggregate the predictions of `n_estimators`-many forward passes of TabPFN. Each forward pass has (slightly) different input data. Think of this as an ensemble of `n_estimators`-many "prompts" of the input data. The server accepts at most 8. If `None`, it applies the model's default:<br /><br />- v3.5 (`"v3.5_default"`, the default model): 8.<br />- v3.5-fast (`"v3.5-fast_default"`): 4.<br />- v3 (`"v3_default"`): 8, raised on wide datasets until every   feature is seen by at least one estimator, up to 32.<br /><br />These are server defaults and may change with server releases. |
  | <span id="constructor-softmax-temperature" /><code className="python-reference-parameter">softmax\_<wbr />temperature</code> | <code className="python-reference-type">float \| None</code> | `None` | The temperature for the softmax function. This is used to control the confidence of the model's predictions. Lower values make the model's predictions more confident. This is only applied when predicting during a post-processing step. Set `softmax_temperature=1.0` for no effect. If `None`, the server default is used. |
  | <span id="constructor-average-before-softmax" /><code className="python-reference-parameter">average\_<wbr />before\_<wbr />softmax</code> | <code className="python-reference-type">bool \| None</code> | `None` | Only used if `n_estimators > 1`. Whether to average the predictions of the estimators before applying the softmax function. This can help to improve predictive performance when calibrating the model's confidence. This is only applied when predicting during a post-processing step. If `None`, the server default is used. |
  | <span id="constructor-ignore-pretraining-limits" /><code className="python-reference-parameter">ignore\_<wbr />pretraining\_<wbr />limits</code> | <code className="python-reference-type">bool</code> | `False` | Whether to ignore the pre-training limits of the model. The TabPFN models have been pre-trained on a specific range of input data. If the input data is outside of this range, the model may not perform well. You may ignore our limits to use the model on data outside the pre-training range. |
  | <span id="constructor-inference-precision" /><code className="python-reference-parameter">inference\_<wbr />precision</code> | <code className="python-reference-type">Literal\["autocast", "auto"] \| None</code> | `None` | The precision to use for inference. This can dramatically affect the speed and reproducibility of the inference. `"autocast"` enables mixed-precision autocast; `"auto"` decides based on the device. If `None`, the server default is used. |
  | <span id="constructor-random-state" /><code className="python-reference-parameter">random\_<wbr />state</code> | <code className="python-reference-type">int \| None</code> | `0` | Controls the randomness of the model. Pass an int for reproducible results; pass `None` to use a fresh random seed each run. |
  | <span id="constructor-inference-config" /><code className="python-reference-parameter">inference\_<wbr />config</code> | <code className="python-reference-type">dict\[str, Any] \| None</code><br /><a href="/api-reference/python/tabpfn/inference-config#inferenceconfig"><code>InferenceConfig</code> options</a> | `None` | For advanced users, additional advanced arguments that adjust the behavior of the model interface. See `InferenceConfig` in the tabpfn package for details and options. For the client, the `inference_config` and the preprocess transforms need to be dictionaries. |
  | <span id="constructor-categorical-features-indices" /><code className="python-reference-parameter">categorical\_<wbr />features\_<wbr />indices</code> | <code className="python-reference-type">list\[int] \| None</code> | `None` | The indices of the columns that should be treated as categorical. If `None`, the model infers which columns are categorical. |
  | <span id="constructor-fit-mode" /><code className="python-reference-parameter">fit\_<wbr />mode</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-client/configuration#fitmodeliteral">Fit<wbr />Mode<wbr />Literal</a> \| None</code> | `None` | Controls what the server persists at fit time. `None` defers to the server default, which is "fit\_preprocessors".<br /><br />- If `"fit_preprocessors"`, only the preprocessing state is fitted, so   every predict re-runs the forward pass from the uploaded train set.<br />- If `"fit_with_cache"`, a server-side KV cache is additionally built   and persisted, keyed by the resulting fitted-train-set id. Later   predicts against that id (stored on the estimator as `model_id_`, and   persisted across runs by [`save_model()`](/api-reference/python/tabpfn-client/regressor/model-selection-and-persistence#save-model)) are served from the cache   instead of re-fitting. |
  | <span id="constructor-paper-version" /><code className="python-reference-parameter">paper\_<wbr />version</code> | <code className="python-reference-type">bool</code> | `False` | If `True`, will use the model described in the paper, instead of the newest version available on the API, which e.g. handles text features better. Cannot be combined with thinking mode. |
  | <span id="constructor-thinking-mode" /><code className="python-reference-parameter">thinking\_<wbr />mode</code> | <code className="python-reference-type">bool</code> | `False` | If `True`, spend extra fit-time compute for higher precision. Equivalent to passing `thinking_effort="medium"`; setting any `thinking_effort` value also enables thinking, so this flag is optional when you've set the level explicitly. |
  | <span id="constructor-thinking-effort" /><code className="python-reference-parameter">thinking\_<wbr />effort</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-client/configuration#thinkingeffort">Thinking<wbr />Effort</a> \| None</code> | `None` | Effort level for thinking mode. When set, thinking is enabled (you don't also need `thinking_mode=True`). When `None` and `thinking_mode=True`, defaults to "medium". |
  | <span id="constructor-thinking-timeout-s" /><code className="python-reference-parameter">thinking\_<wbr />timeout\_<wbr />s</code> | <code className="python-reference-type">float \| None</code> | `None` | Budget for the fit, in seconds. Only consulted when thinking is enabled. Capped at 2400. |
  | <span id="constructor-thinking-metric" /><code className="python-reference-parameter">thinking\_<wbr />metric</code> | <code className="python-reference-type">str \| None</code> | `None` | Optimization metric for the fit. Only consulted when thinking is enabled.<br /><br />Regression:     "r2", "mean\_squared\_error", "root\_mean\_squared\_error",     "mean\_absolute\_error", "median\_absolute\_error",     "mean\_absolute\_percentage\_error",     "symmetric\_mean\_absolute\_percentage\_error", "spearmanr",     "pearsonr".<br /><br />Aliases "mse", "rmse", "mae", "mape", "smape" are also accepted. |
  | <span id="constructor-group-col" /><code className="python-reference-parameter">group\_<wbr />col</code> | <code className="python-reference-type">str \| list\[str] \| None</code> | `None` | New since 0.6.0. Column(s) of `X` that identify groups of related rows, e.g. a patient or a session id. During the fit, the rows of one group are never split between training and validation. The fit may also use the other rows of a group to predict a row of it. Requires thinking mode, and `X` passed to [`fit`](/api-reference/python/tabpfn-client/regressor/fitting-and-prediction#fit) and [`predict`](/api-reference/python/tabpfn-client/regressor/fitting-and-prediction#predict) must be a pandas DataFrame that holds the column(s). |
  | <span id="constructor-time-col" /><code className="python-reference-parameter">time\_<wbr />col</code> | <code className="python-reference-type">str \| None</code> | `None` | New since 0.6.0. Column of `X` that holds time, as datetimes or numbers. During the fit, validation uses contiguous blocks of time. Cannot be combined with `group_col`. Requires thinking mode, and `X` must be a pandas DataFrame that holds the column. |
  | <span id="constructor-group-time-col" /><code className="python-reference-parameter">group\_<wbr />time\_<wbr />col</code> | <code className="python-reference-type">str \| None</code> | `None` | New since 0.6.0. Column of `X` that orders the rows within a group. Requires `group_col` and thinking mode, and `X` must be a pandas DataFrame that holds the column. |
  | <span id="constructor-api-mode" /><code className="python-reference-parameter">api\_<wbr />mode</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-client/configuration#apimode">Api<wbr />Mode</a></code> | `ApiMode.AUTO` | Controls how the client calls the server.<br /><br />- `SYNC`: the client waits for the server to complete the request   before returning.<br />- `ASYNC`: the client returns immediately and the server completes the   request in the background.<br />- `AUTO`: the client determines the best mode based on the request. |
  | <span id="constructor-client-options" /><code className="python-reference-parameter">client\_<wbr />options</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-client/configuration#clientoptions">Client<wbr />Options</a> \| None</code> | `None` | Client specific options (e.g. timeout, headers). |
  | <span id="constructor-text-handling" /><code className="python-reference-parameter">text\_<wbr />handling</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-client/configuration#texthandling">Text<wbr />Handling</a></code> | `"advanced"` | Text-processing preset. Both choices support text. Advanced preserves the default processing; simple is an alternative whose accuracy depends on the dataset. Applies when preprocessing is enabled. |
</div>

**Usage guidance**

* TabPFN-3 and later versions support up to 1,000,000 rows, subject to
  feature count and model/API limits.
* For large datasets, use per-estimator subsampling,
  e.g. `inference_config={"SUBSAMPLE_SAMPLES": 100_000}`.
* Pass raw pandas DataFrames to [`fit`](/api-reference/python/tabpfn-client/regressor/fitting-and-prediction#fit) and [`predict`](/api-reference/python/tabpfn-client/regressor/fitting-and-prediction#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.

## Scikit-learn configuration

Use inherited [`get_params`](https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html#sklearn.base.BaseEstimator.get_params) and [`set_params`](https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html#sklearn.base.BaseEstimator.set_params) to inspect or update constructor settings.


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