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

<Info>
  Looking for usage documentation? Check out [Many class](/capabilities/many-class).
</Info>

## Installation

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

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier">
    `ManyClassClassifier`
  </h2>

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

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

<div className="python-reference-table">
  | Parameter | Type | Default | Description |
  | - | - | - | - |
  | <span id="many-class-many-class-classifier-manyclassclassifier--estimator" /><code className="python-reference-parameter">estimator</code> | <code className="python-reference-type">Base<wbr />Estimator</code> | Required | Base classifier (typically a TabPFN classifier) used as the underlying model. |
  | <span id="many-class-many-class-classifier-manyclassclassifier--alphabet-size" /><code className="python-reference-parameter">alphabet\_<wbr />size</code> | <code className="python-reference-type">int \| None</code> | `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`. |
  | <span id="many-class-many-class-classifier-manyclassclassifier--n-estimators" /><code className="python-reference-parameter">n\_<wbr />estimators</code> | <code className="python-reference-type">int \| None</code> | `None` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--n-estimators-redundancy" /><code className="python-reference-parameter">n\_<wbr />estimators\_<wbr />redundancy</code> | <code className="python-reference-type">int</code> | `4` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--random-state" /><code className="python-reference-parameter">random\_<wbr />state</code> | <code className="python-reference-type">int \| None</code> | `None` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--verbose" /><code className="python-reference-parameter">verbose</code> | <code className="python-reference-type">int</code> | `0` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--codebook-config" /><code className="python-reference-parameter">codebook\_<wbr />config</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-extensions/many-class#many-class-codebookconfig">Codebook<wbr />Config</a> \| str \| None</code> | `None` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--row-weighting-config" /><code className="python-reference-parameter">row\_<wbr />weighting\_<wbr />config</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-extensions/many-class#many-class-rowweightingconfig">Row<wbr />Weighting<wbr />Config</a> \| <a href="/api-reference/python/tabpfn-extensions/many-class#many-class-weightmode">Weight<wbr />Mode</a> \| str \| None</code> | `None` | — |
  | <span id="many-class-many-class-classifier-manyclassclassifier--aggregation-config" /><code className="python-reference-parameter">aggregation\_<wbr />config</code> | <code className="python-reference-type"><a href="/api-reference/python/tabpfn-extensions/many-class#many-class-aggregationconfig">Aggregation<wbr />Config</a> \| None</code> | `None` | — |
</div>

***

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier-codebook-statistics">
    `ManyClassClassifier.codebook_statistics_`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier-fit">
    `ManyClassClassifier.fit`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier-predict">
    `ManyClassClassifier.predict`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier-predict-proba">
    `ManyClassClassifier.predict_proba`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-many-class-classifier-manyclassclassifier-set-categorical-features">
    `ManyClassClassifier.set_categorical_features`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-aggregationconfig">
    `AggregationConfig`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-codebookconfig">
    `CodebookConfig`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-rowweightingconfig">
    `RowWeightingConfig`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-rowweightingconfig-resolved-mode">
    `RowWeightingConfig.resolved_mode`
  </h2>

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

***

<div className="python-reference-heading">
  <h2 id="many-class-weightmode">
    `WeightMode`
  </h2>

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


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