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

# Fitting and prediction

> Fit, predict, and inspect server timings with TabPFNClassifier.

<Info>
  Looking for usage documentation? Check out [Classification](/capabilities/classification) and [KV cache](/capabilities/kv-cache).
</Info>

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

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

Fit the model.

Uploads the training data to the server, which fits the model on it.

```python theme={null}
TabPFNClassifier.fit(
    X: pd.DataFrame | np.ndarray,
    y: pd.Series | np.ndarray,
    description: str | None = None,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="fit-x" /><code className="python-reference-parameter">X</code> | <code className="python-reference-type"><a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html">pd.Data<wbr />Frame</a> \| <a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html">np.ndarray</a></code> | Required | The input data. |
  | <span id="fit-y" /><code className="python-reference-parameter">y</code> | <code className="python-reference-type"><a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.html">pd.Series</a> \| <a href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html">np.ndarray</a></code> | Required | The target variable. |
  | <span id="fit-description" /><code className="python-reference-parameter">description</code> | <code className="python-reference-type">str \| None</code> | `None` | Description of the dataset and task for the server. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | — | self |
</div>

**Raises**

`ValueError`

If the data or the estimator's parameters are invalid,
or the data exceeds the model limits.

***

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

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

Predict the class labels for the provided input samples.

```python theme={null}
TabPFNClassifier.predict(
    X,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="predict-x" /><code className="python-reference-parameter">X</code> | — | Required | The input data for prediction. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | — | The predicted class labels as a NumPy array. |
</div>

***

<div className="python-reference-heading">
  <h2 id="predict-proba">
    `TabPFNClassifier.predict_proba`
  </h2>

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

Predict the probabilities of the classes for the provided input samples.

```python theme={null}
TabPFNClassifier.predict_proba(
    X,
)
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="predict-proba-x" /><code className="python-reference-parameter">X</code> | — | Required | The input data for prediction. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | — | The predicted probabilities of the classes as a NumPy array. Shape (n\_samples, n\_classes). |
</div>

***

<div className="python-reference-heading">
  <h2 id="get-timings">
    `TabPFNClassifier.get_timings`
  </h2>

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

Seconds the server spent on the last fit and the last prediction.

Returns `{"fit": ..., "predict": ...}`:

* [`fit`](/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#fit): `elapsed_s`, `queue_wait_s`, `train_set_transform_s`,
  `fit_s`.
* [`predict`](/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#predict): `test_set_transform_queue_wait_s`,
  `test_set_transform_s`, `predict_queue_wait_s`, `predict_s`.
  A prediction sent in several requests reports their sum.

Queue wait is time spent waiting for the server to start the work. An
entry is `None` before the first call, on a model restored with
[`load_model()`](/api-reference/python/tabpfn-client/classifier/model-selection-and-persistence#load-model), and when the server does not report timings.

```python theme={null}
TabPFNClassifier.get_timings() -> dict[str, dict[str, Any] | None]
```

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type">dict\[str, dict\[str, Any] \| None]</code> | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="last-predict-timings">
    `TabPFNClassifier.last_predict_timings`
  </h2>

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

Seconds per stage of the most recent prediction, or `None`.

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type">dict\[str, Any] \| None</code> | — |
</div>

## Scikit-learn scoring

Inherited [`score(X, y, sample_weight=None)`](https://scikit-learn.org/stable/modules/generated/sklearn.base.ClassifierMixin.html#sklearn.base.ClassifierMixin.score) calls `predict` and returns mean classification accuracy.


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