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

# Many-class classification

> Output-coding wrapper that enables TabPFN-style estimators to handle many classes.

> [!NOTE]
>
> Looking for usage documentation? Check out [Many class](https://docs.priorlabs.ai/capabilities/many-class.md).

## Installation

```bash theme={null}
pip install "tabpfn-extensions[many_class]"
```

## `ManyClassClassifier`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L33)

Output-coding wrapper that enables TabPFN-style estimators to handle many classes.

```python theme={null}
ManyClassClassifier(
    estimator: BaseEstimator,
    *,
    alphabet_size: int | None = None,
    n_estimators: int | None = None,
    n_estimators_redundancy: int = 4,
    random_state: int | None = None,
    verbose: int = 0,
    codebook_config: CodebookConfig | str | None = None,
    row_weighting_config: RowWeightingConfig | WeightMode | str | None = None,
    aggregation_config: AggregationConfig | None = None,
)
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `estimator` | `BaseEstimator` | Required | Base classifier (typically a TabPFN classifier) used as the underlying model. |
| `alphabet_size` | `int \| None` | `None` | Maximum number of classes the base estimator handles in a single fit. When `None`, it is inferred from the base estimator's checkpoint `MAX_NUMBER_OF_CLASSES`. |
| `n_estimators` | `int \| None` | `None` | — |
| `n_estimators_redundancy` | `int` | `4` | — |
| `random_state` | `int \| None` | `None` | — |
| `verbose` | `int` | `0` | — |
| `codebook_config` | `CodebookConfig \| str \| None` | `None` | — |
| `row_weighting_config` | `RowWeightingConfig \| WeightMode \| str \| None` | `None` | — |
| `aggregation_config` | `AggregationConfig \| None` | `None` | — |

***

## `ManyClassClassifier.codebook_statistics_`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L442)

***

## `ManyClassClassifier.fit`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L180)

***

## `ManyClassClassifier.predict`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L386)

***

## `ManyClassClassifier.predict_proba`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L276)

***

## `ManyClassClassifier.set_categorical_features`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/many_class_classifier.py#L405)

***

## `AggregationConfig`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/_strategies.py#L87)

***

## `CodebookConfig`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/_strategies.py#L49)

***

## `RowWeightingConfig`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/_strategies.py#L73)

***

## `RowWeightingConfig.resolved_mode`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/_strategies.py#L78)

***

## `WeightMode`

[ View source ](https://github.com/PriorLabs/tabpfn-extensions/blob/840c15a1848a986b39c85bc17efc61e0e377f983/src/tabpfn_extensions/many_class/_strategies.py#L43)


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