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

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-embeddingunsupervisedexperiment">
    `EmbeddingUnsupervisedExperiment`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L42" aria-label="View source for EmbeddingUnsupervisedExperiment"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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

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

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="unsupervised-experiments-embeddingunsupervisedexperiment--task-type" /><code className="python-reference-parameter">task\_<wbr />type</code> | — | Required | — |
  | <span id="unsupervised-experiments-embeddingunsupervisedexperiment--kwargs" /><code className="python-reference-parameter">\*\*kwargs</code> | — | — | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-embeddingunsupervisedexperiment-plot">
    `EmbeddingUnsupervisedExperiment.plot`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L82" aria-label="View source for EmbeddingUnsupervisedExperiment.plot"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-embeddingunsupervisedexperiment-run">
    `EmbeddingUnsupervisedExperiment.run`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L89" aria-label="View source for EmbeddingUnsupervisedExperiment.run"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-generatesyntheticdataexperiment">
    `GenerateSyntheticDataExperiment`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L113" aria-label="View source for GenerateSyntheticDataExperiment"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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

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

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment--task-type" /><code className="python-reference-parameter">task\_<wbr />type</code> | — | Required | — |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment--kwargs" /><code className="python-reference-parameter">\*\*kwargs</code> | — | — | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-generatesyntheticdataexperiment-plot">
    `GenerateSyntheticDataExperiment.plot`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L118" aria-label="View source for GenerateSyntheticDataExperiment.plot"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-generatesyntheticdataexperiment-run">
    `GenerateSyntheticDataExperiment.run`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L125" aria-label="View source for GenerateSyntheticDataExperiment.run"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment-run--tabpfn" /><code className="python-reference-parameter">tabpfn</code> | — | Required | A [`TabPFNUnsupervisedModel`](/api-reference/python/tabpfn-extensions/unsupervised/model#unsupervised-unsupervised-tabpfnunsupervisedmodel) used to learn the joint distribution of the selected features and sample synthetic rows. |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment-run--categorical-features" /><code className="python-reference-parameter">categorical\_<wbr />features</code> | — | `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. |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment-run--should-plot" /><code className="python-reference-parameter">should\_<wbr />plot</code> | — | `True` | Whether to render the pairwise plot. Defaults to `True`. |
  | <span id="unsupervised-experiments-generatesyntheticdataexperiment-run--kwargs" /><code className="python-reference-parameter">\*\*kwargs</code> | — | — | 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. |
</div>

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

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

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-outlierdetectionunsupervisedexperiment">
    `OutlierDetectionUnsupervisedExperiment`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L234" aria-label="View source for OutlierDetectionUnsupervisedExperiment"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

This class is used to run experiments for outlier detection.

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

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment--task-type" /><code className="python-reference-parameter">task\_<wbr />type</code> | — | Required | — |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment--kwargs" /><code className="python-reference-parameter">\*\*kwargs</code> | — | — | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-plot">
    `OutlierDetectionUnsupervisedExperiment.plot`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L239" aria-label="View source for OutlierDetectionUnsupervisedExperiment.plot"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-plot-two">
    `OutlierDetectionUnsupervisedExperiment.plot_two`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L246" aria-label="View source for OutlierDetectionUnsupervisedExperiment.plot_two"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

***

<div className="python-reference-heading">
  <h2 id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run">
    `OutlierDetectionUnsupervisedExperiment.run`
  </h2>

  <a className="python-reference-source" href="https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/unsupervised/experiments.py#L324" aria-label="View source for OutlierDetectionUnsupervisedExperiment.run"><span aria-hidden="true">\</></span> View source <span aria-hidden="true">↗</span></a>
</div>

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

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--tabpfn" /><code className="python-reference-parameter">tabpfn</code> | — | Required | A [`TabPFNUnsupervisedModel`](/api-reference/python/tabpfn-extensions/unsupervised/model#unsupervised-unsupervised-tabpfnunsupervisedmodel) used to estimate sample density. |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--overwrite-baseline-cache" /><code className="python-reference-parameter">overwrite\_<wbr />baseline\_<wbr />cache</code> | — | `False` | Unused placeholder kept for API symmetry. |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--overwrite-tabpfn-cache" /><code className="python-reference-parameter">overwrite\_<wbr />tabpfn\_<wbr />cache</code> | — | `True` | Unused placeholder kept for API symmetry. |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--categorical-features" /><code className="python-reference-parameter">categorical\_<wbr />features</code> | — | `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. |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--should-plot" /><code className="python-reference-parameter">should\_<wbr />plot</code> | — | `True` | Whether to render the density plot. Defaults to `True`. |
  | <span id="unsupervised-experiments-outlierdetectionunsupervisedexperiment-run--kwargs" /><code className="python-reference-parameter">\*\*kwargs</code> | — | — | 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`. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | — | `dict`: Mapping with key `"log_p"` holding the per-sample log-density     (lower values indicate more likely outliers). |
</div>


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