Skip to main content
This Many Class Classifier Extension allows TabPFN to handle classification problems with more classes than TabPFN’s default limit (currently 10 classes). It works through an error-correcting output code (ECOC) approach that:
  • Encodes the multi-class task into multiple binary or small-class subtasks.
  • Trains the base TabPFNClassifier on these subtasks.
  • Decodes the results back into the original class space.
This approach enables TabPFN to scale to hundreds of classes efficiently while maintaining accuracy and calibration.

Getting Started

Install the many_class extension:
pip install "tabpfn-extensions[many_class]"
Then, simply wrap your existing TabPFNClassifier with ManyClassClassifier to enable support for datasets with large number of classes.
from tabpfn_extensions.manyclass_classifier import ManyClassClassifier
from tabpfn import TabPFNClassifier

estimator = TabPFNClassifier(device="cuda")
classifier = ManyClassClassifier(base_estimator=estimator)
classifier.fit(X_train, y_train)
predictions = classifier.predict(X_test)