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

# Unsupervised experiments

> Unsupervised experiments

## `EmbeddingUnsupervisedExperiment`

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

This class is used to run experiments on synthetic toy functions.

```python theme={null}
EmbeddingUnsupervisedExperiment(
    task_type,
    **kwargs,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `task_type` | — | Required | — |
| `**kwargs` | — | — | — |

***

## `EmbeddingUnsupervisedExperiment.plot`

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

***

## `EmbeddingUnsupervisedExperiment.run`

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

***

## `GenerateSyntheticDataExperiment`

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

This class is used to run experiments on generating synthetic data.

```python theme={null}
GenerateSyntheticDataExperiment(
    task_type,
    **kwargs,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `task_type` | — | Required | — |
| `**kwargs` | — | — | — |

***

## `GenerateSyntheticDataExperiment.plot`

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

***

## `GenerateSyntheticDataExperiment.run`

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

Generate synthetic data and store it on the experiment instance.

The following properties are also set

* data\_real: input X data as a DataFrame, potentially resampled
* data\_synthetic: synthetic\_X as a DataFrame, potentially resampled
* data: data\_real and data\_synthetic concatenated
  If one of data\_real or data\_synthetic has fewer rows, it is resampled with
  replacement so both have max(n\_input\_samples, n\_samples) rows.
  data\_real, data\_synthetic, and data have an additional real\_or\_synthetic column
  that indicates if the data is real or synthetic.

```python theme={null}
GenerateSyntheticDataExperiment.run(
    tabpfn,
    *,
    categorical_features = None,
    should_plot = True,
    **kwargs,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `tabpfn` | — | Required | A [`TabPFNUnsupervisedModel`](https://docs.priorlabs.ai/api-reference/python/tabpfn-extensions/unsupervised/model#unsupervised-unsupervised-tabpfnunsupervisedmodel) used to learn the joint distribution of the selected features and sample synthetic rows. |
| `categorical_features` | — | `None` | Column indices of `X` (same index space as `indices`) to treat as categorical. Indices not present in `indices` are ignored. Defaults to `None`, in which case the model auto-detects categorical columns at `fit` time. |
| `should_plot` | — | `True` | Whether to render the pairwise plot. Defaults to `True`. |
| `**kwargs` | — | — | Keyword arguments controlling the run: X: Input data array of shape `(n_input_samples, n_features)`. y: Targets (unused for unsupervised generation; may be empty). attribute\_names: Column names for every column in `X`. indices: Column indices of `X` to model. Defaults to all columns. temp: Sampling temperature. Defaults to `1.0`. n\_samples: Number of synthetic rows to generate. Defaults to     `X.shape[0]`. n\_permutations: Number of feature-order permutations to average.     Defaults to `3`. dag: Optional causal DAG passed to the generator. |

**The synthetic data is stored on the following instance property**

* synthetic\_X: array with shape (n\_samples, n selected columns)

***

## `OutlierDetectionUnsupervisedExperiment`

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

This class is used to run experiments for outlier detection.

```python theme={null}
OutlierDetectionUnsupervisedExperiment(
    task_type,
    **kwargs,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `task_type` | — | Required | — |
| `**kwargs` | — | — | — |

***

## `OutlierDetectionUnsupervisedExperiment.plot`

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

***

## `OutlierDetectionUnsupervisedExperiment.plot_two`

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

***

## `OutlierDetectionUnsupervisedExperiment.run`

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

Estimate per-sample outlier scores for the selected features.

```python theme={null}
OutlierDetectionUnsupervisedExperiment.run(
    tabpfn,
    overwrite_baseline_cache = False,
    overwrite_tabpfn_cache = True,
    *,
    categorical_features = None,
    should_plot = True,
    **kwargs,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `tabpfn` | — | Required | A [`TabPFNUnsupervisedModel`](https://docs.priorlabs.ai/api-reference/python/tabpfn-extensions/unsupervised/model#unsupervised-unsupervised-tabpfnunsupervisedmodel) used to estimate sample density. |
| `overwrite_baseline_cache` | — | `False` | Unused placeholder kept for API symmetry. |
| `overwrite_tabpfn_cache` | — | `True` | Unused placeholder kept for API symmetry. |
| `categorical_features` | — | `None` | Column indices of `X` (same index space as `indices`) to treat as categorical. Indices not present in `indices` are ignored. Defaults to `None`, in which case the model auto-detects categorical columns at `fit` time. |
| `should_plot` | — | `True` | Whether to render the density plot. Defaults to `True`. |
| `**kwargs` | — | — | Keyword arguments controlling the run: X: Input data array of shape `(n_samples, n_features)`. y: Targets (unused; may be empty). attribute\_names: Column names for every column in `X`. indices: Column indices of `X` to model. Defaults to all columns. n\_permutations: Number of feature-order permutations to average.     Defaults to `3`. |

**Returns**

| Type | Description |
| - | - |
| — | `dict`: Mapping with key `"log_p"` holding the per-sample log-density     (lower values indicate more likely outliers). |


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