Skip to main content

TabPFN-Wide

DOI: 10.48550/arXiv.2510.06162 Citation Badge Python Versions License

TabPFN-Wide is an extension of the TabPFN-2 foundation model, specifically designed for wide datasets (many features, few samples), such as multi-omics data. It allows for training and evaluating large-scale tabular models that can handle thousands of features.

Publication

The TabPFN-Wide preprint is available at arXiv.

License

The model weights and code of the tabpfnwide project are licensed under the Prior Labs License Version 1.1.

Quick Start

Installation

Using pip:

pip install tabpfnwide

From Source:

pip install "tabpfnwide @ git+https://github.com/not-a-feature/TabPFN-Wide.git"

Model Weights

Model weights are automatically downloaded from GitHub Releases upon first use and cached in ~/.tabpfnwide/models/. If you are running in an offline environment, you can manually download the .pt files from the Releases page and place them in that directory.

Basic Usage

TabPFN-Wide works just like a scikit-learn classifier.

from tabpfnwide.classifier import TabPFNWideClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split

# Load a 'wide' dataset (or any tabular data)
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Initialize the classifier with a wide model (e.g., handles up to 5k features)
clf = TabPFNWideClassifier(model_name="wide-v2-5k", device="cpu")

# Fit and predict
clf.fit(X_train, y_train)
predictions = clf.predict(X_test)

See demo_run_prediction.py for more details

Interpreting the Model

TabPFN-Wide provides built-in tools to extract attention-based feature importance.

import numpy as np

# Note: Attention maps require n_estimators=1 and features_per_group=1
clf = TabPFNWideClassifier(
    model_name="wide-v2-5k",
    save_attention_maps=True,
    n_estimators=1,
    features_per_group=1
)
clf.fit(X_train, y_train)

# Attention maps are recorded during the forward pass, so call predict
# (or predict_proba) before reading them. Each call resets the buffers,
# so the readouts below reflect this most recent forward pass only.
clf.predict_proba(X_test)

# 1. Get raw feature-to-feature attention maps (list of maps per layer)
attn_per_layer = clf.get_attention_maps()
avg_attn_matrix = np.mean(attn_per_layer, axis=0)

# 2. Get direct feature importance based on label-to-feature attention
# This represents how much the model's prediction 'attends' to each input feature
importances = clf.get_attention_to_label()

See demo_attention_maps.py for more details.

Continued Pretraining

The training logic is contained in the training/ directory. You can run training jobs using the provided python script or shell wrapper.

Using the Python script:

python training/train.py \
    --prior_type mlp_scm \
    --prior_max_features 100 \
    --batch_size 8

Using the shell script:

bash training/train.sh

Evaluation & Analysis

bash analysis/run_analysis.sh "$CHECKPOINT_PATH" "$OUTPUT_DIR"

See analysis/analysis.sbatch for more details.


For the original TabPFN work, please cite:

@article{hollmann2025tabpfn,
 title={Accurate predictions on small data with a tabular foundation model},
 author={Hollmann, Noah and M{\"u}ller, Samuel and Purucker, Lennart and
         Krishnakumar, Arjun and K{\"o}rfer, Max and Hoo, Shi Bin and
         Schirrmeister, Robin Tibor and Hutter, Frank},
 journal={Nature},
 year={2025},
 month={01},
 day={09},
 doi={10.1038/s41586-024-08328-6},
 publisher={Springer Nature},
 url={https://www.nature.com/articles/s41586-024-08328-6},
}

Development & Support

Contact: For issues, please open a ticket on the Issue Tracker.

Metadata

Release files for tabpfnwide 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tabpfnwide 0.4.0
File Size Uploaded
tabpfnwide-0.4.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tabpfnwide 0.4.0
File Interpreter ABI Platform
tabpfnwide-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / tabpfnwide-0.4.0.tar.gz

Download URL tabpfnwide-0.4.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
66c24ab8897d4a1a1c36cc0093155ebdf880996c05a7dde723ae9dcdfe326566
BLAKE2b-256 checksum
How to use checksums
ad12b4d21efa1287596b5011b5007b4286ffc7f1842591daaf328d045c8a8f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / tabpfnwide-0.4.0-py3-none-any.whl

Download URL tabpfnwide-0.4.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
331b86b705270e5a351783c7d4b08369dbf627cbf842a7aea6d20ae4a6847b55
BLAKE2b-256 checksum
How to use checksums
0dfc968ea709d35f7dcae8200d992d0a0592681a970a1299d78996f90cf85320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.1

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page