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

# Sample weights and label reliability

> Tell TabPFN-4 how much each training row should count and how far to trust its label.

TabPFN-4 takes two optional per-row inputs at fit time:

* **Sample weight**: how much influence a row has, roughly how many rows it stands for. Weight loans by outstanding balance so larger exposures count more, or down-weight an over-sampled period.
* **Label reliability**: how much to trust a row's label, from `1` (known to be right) to `0` (carries no information). Give verified outcomes `1.0` and provisional ones a lower score.

> [!NOTE]
>
> Both inputs are experimental. They require TabPFN-4 on the hosted API and `tabpfn-client` **0.11.0 or later**. Other models reject them.

***

## Quickstart

```python theme={null}
from tabpfn_client import TabPFNClassifier

clf = TabPFNClassifier(model_path="v4_default")
clf.fit(
    X_train,
    y_train,
    sample_weight=outstanding_balance_train,
    label_reliability=label_confidence_train,
)
probs = clf.predict_proba(X_test)
```

Pass either argument or both, with one value per training row in the same order as `X_train`. `TabPFNRegressor.fit()`, `submit_fit()` and `cross_val_predict()` take the same arguments; in cross-validation each fold fits with the weights of its training rows. Predictions take no weights.

***

## Rules

* `sample_weight` must be non-negative, and at least one weight must be positive. Only relative values matter: the weights are rescaled, so multiplying all of them by a constant changes nothing.
* For classification, every class must keep a positive total `sample_weight`.
* `label_reliability` must lie in `[0, 1]`.
* [Thinking mode](https://docs.priorlabs.ai/capabilities/thinking-mode.md) does not take either input yet; the API rejects the fit with HTTP 422.
* Both work with the [KV cache](https://docs.priorlabs.ai/capabilities/kv-cache.md) (`fit_mode="fit_with_cache"`).

***

## REST API

Upload the weights as a third file next to the features and targets. In `POST /tabpfn/prepare_train_set_upload`, add `row_weights_info`:

```json theme={null}
{
  "x_train_info": {"format": "csv"},
  "y_train_info": {"format": "csv"},
  "row_weights_info": {"format": "csv"}
}
```

Upload the file to the signed URL in the response's `row_weights_info`, with its required headers. The file has one row per training row, in the same order, and a `sample_weight` column, a `label_reliability` column, or both:

```csv theme={null}
sample_weight,label_reliability
2,1.0
1,0.7
1,1.0
```

Then fit with `"model_path": "v4_default"` as usual. See the [REST quickstart](https://docs.priorlabs.ai/api/rest-quickstart.md#3-upload-the-training-set) for the upload flow.

***

> [card] [Grouped data](https://docs.priorlabs.ai/capabilities/grouped-data.md)
>
> Tell TabPFN which rows belong to the same entity.

> [card] [Classification](https://docs.priorlabs.ai/capabilities/classification.md)
>
> Binary and multi-class classification guide.


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