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

# Predictive distributions

> Plot a predictive distribution returned by the hosted regressor.

<Info>
  Looking for usage documentation? Check out [Predictive distribution](/capabilities/predictive-distribution) and [Regression](/capabilities/regression).
</Info>

<div className="python-reference-heading">
  <h2 id="plot-regression-distribution">
    `visualisation.plot_regression_distribution`
  </h2>

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

Plot the predicted target distribution for a single sample.

```python theme={null}
visualisation.plot_regression_distribution(
    prediction: Mapping[str, Any],
    *,
    sample_idx: int = 0,
    statistics: Sequence[str] = ("mean", "median", "mode"),
    quantile_interval: tuple[float, float] | None = (0.1, 0.9),
    zoom_quantile: float | None = 0.99,
    smooth: float = 0.005,
    ax: Axes | None = None,
    color: str = "#1f77b4",
) -> Axes
```

**Parameters**

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="plot-regression-distribution-prediction" /><code className="python-reference-parameter">prediction</code> | <code className="python-reference-type">Mapping\[str, Any]</code> | Required | Output of `regressor.predict(X, output_type="full")`. It may hold several samples; pick the one to plot with `sample_idx`. |
  | <span id="plot-regression-distribution-sample-idx" /><code className="python-reference-parameter">sample\_<wbr />idx</code> | <code className="python-reference-type">int</code> | `0` | Index of the sample to plot within `prediction`. |
  | <span id="plot-regression-distribution-statistics" /><code className="python-reference-parameter">statistics</code> | <code className="python-reference-type">Sequence\[str]</code> | `("mean", "median", "mode")` | Point statistics to mark with a vertical line. Each one must be present in `prediction`. |
  | <span id="plot-regression-distribution-quantile-interval" /><code className="python-reference-parameter">quantile\_<wbr />interval</code> | <code className="python-reference-type">tuple\[float, float] \| None</code> | `(0.1, 0.9)` | Central interval to shade. Pass `None` to disable. |
  | <span id="plot-regression-distribution-zoom-quantile" /><code className="python-reference-parameter">zoom\_<wbr />quantile</code> | <code className="python-reference-type">float \| None</code> | `0.99` | Fraction of probability mass to keep in view, centred on the median. Pass `None` to show the full support. |
  | <span id="plot-regression-distribution-smooth" /><code className="python-reference-parameter">smooth</code> | <code className="python-reference-type">float</code> | `0.005` | Width of the display-only moving average over the density, as a fraction of the number of bars. Pass `0` to show the raw bar density. |
  | <span id="plot-regression-distribution-ax" /><code className="python-reference-parameter">ax</code> | <code className="python-reference-type"><a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html">Axes</a> \| None</code> | `None` | Existing axes to draw on. A new figure is created if omitted. When the axes already holds a curve, the limits, labels and legend of that curve are preserved so several distributions can be overlaid. |
  | <span id="plot-regression-distribution-color" /><code className="python-reference-parameter">color</code> | <code className="python-reference-type">str</code> | `"#1f77b4"` | Base colour of the density curve. |
</div>

**Returns**

<div className="python-reference-table python-reference-returns">
  | Type | Description |
  | - | - |
  | <code className="python-reference-type"><a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html">Axes</a></code> | The axes containing the plot. |
</div>

**Raises**

`ValueError`

If `prediction` or the other arguments are invalid.

`ModuleNotFoundError`

If matplotlib is not installed.

Plotting requires `pip install "tabpfn-client[viz]"`.


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