百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

TabPFN

> DevOps
开源

⚡ TabPFN: 表格数据的基础模型

7.7K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

⚡ TabPFN: 表格数据的基础模型

TabPFN

Quick Start

Interactive Notebook Tutorial

[!TIP]

Dive right in with our interactive Colab notebook! It's the best way to get a hands-on feel for TabPFN, walking you through installation, classification, and regression examples.

Installation

pip install tabpfn

TabPFN supports Python 3.10+.

⚡ GPU Recommended: For optimal performance, use a GPU (even older ones with ~8GB VRAM work well; 16GB needed for some large datasets). On CPU, only moderate datasets are feasible (TabPFN-3 and TabPFN-3.5 allow up to 5000 samples; older versions up to 1000). No GPU? Use our free hosted inference via TabPFN Client.

On macOS: GPU support is automatically included for Apple Silicon Macs. For best performance, ensure you are using PyTorch 2.13 or newer (see #949).

On Linux: Nvidia GPU support is automatically included. For AMD GPUs, first install PyTorch with ROCm, then install TabPFN. For example,

pip install torch --index-url https://download.pytorch.org/whl/rocm7.2
pip install tabpfn

For a CPU-only install, first install CPU-only PyTorch, then install TabPFN. This saves disk space if you do not have a GPU.

On Windows: For Nvidia GPUs, install PyTorch with CUDA, then install TabPFN. For AMD GPUs, install PyTorch with ROCm, then install TabPFN.

Basic Usage

To use our default TabPFN-3.5 model:

from tabpfn import TabPFNClassifier, TabPFNRegressor

clf = TabPFNClassifier()
clf.fit(X_train, y_train)  # downloads checkpoint on first use
predictions = clf.predict(X_test)

reg = TabPFNRegressor()
reg.fit(X_train, y_train)  # downloads checkpoint on first use
predictions = reg.predict(X_test)

To use the smaller, faster TabPFN-3.5-Fast you can use ModelVersion.V3_5_FAST or "v3.5-fast".

from tabpfn.constants import ModelVersion

classifier = TabPFNClassifier.create_default_for_version(ModelVersion.V3_5_FAST)
regressor = TabPFNRegressor.create_default_for_version(ModelVersion.V3_5_FAST)

To use other model versions (e.g. the previous default, TabPFN-3):

classifier = TabPFNClassifier.create_default_for_version(ModelVersion.V3)
regressor = TabPFNRegressor.create_default_for_version(ModelVersion.V3)

For complete examples, see the tabpfn_for_binary_classification.py, tabpfn_for_multiclass_classification.py, and tabpfn_for_regression.py files.

TabPFN Ecosystem

Choose the right TabPFN implementation for your needs:

  • TabPFN Client Simple API client for using TabPFN via cloud-based inference.

  • TabPFN Extensions Community extensions and integrations, including:

    • interpretability: Gain insights with SHAP-based explanations, feature importance, and selection tools.
    • unsupervised: Tools for outlier detection and synthetic tabular data generation.
    • embeddings: Extract and use TabPFN's internal learned embeddings for downstream tasks or analysis.
    • many_class: Handle multi-class classification problems that exceed TabPFN's built-in class limit.

    To install:

    pip install tabpfn-extensions
    
  • TabPFN (this repo) Core implementation for fast and local inference with PyTorch and CUDA support.

  • TabPFN UX No-code graphical interface to explore TabPFN capabilities—ideal for business users and prototyping.

License

The code in this repository is licensed under the Apache License 2.0. Third-party code is subject to its own licenses and attribution requirements; see Third-Party Notices.

Model weights are licensed separately.

The TabPFN-2.5, TabPFN-2.6, TabPFN-3 and TabPFN-3.5 model weights are released under non-commercial licenses (TabPFN-3.5 license, TabPFN-3 license; see the Models page for prior releases). TabPFN-3.5 is used by default.

The TabPFN-2 model weights are licensed under the Prior Labs License (Apache 2.0 with an additional attribution requirement): classifier license, regressor license. To use the v2 model weights, instantiate your model as follows:

from tabpfn import TabPFNRegressor
from tabpfn.constants import ModelVersion

tabpfn_v2 = TabPFNRegressor.create_default_for_version(ModelVersion.V2)

Enterprise & Production

For high-throughput or massive-scale production environments, we offer an Enterprise Edition with the following capabilities:

  • Fast Inference Mode: A proprietary distillation engine that converts TabPFN into a compact MLP or tree ensemble, delivering orders-of-magnitude lower latency for real-time applications.
  • Commercial Support: Includes a Commercial Enterprise License for production use-cases, dedicated integration support, and access to private high-speed inference engines.

To learn more or request a commercial license, please contact us at [email protected].

Join Our Community

We're building the future of tabular machine learning and would love your involvement:

  1. Connect & Learn:

    • Join our Discord Community
    • Read our Documentation
    • Check out GitHub Issues
  2. Contribute:

    • Report bugs or request features
    • Share your research and use cases
    • Submit pull requests — please open an issue first (see below)
  3. Stay Updated: Star the repo and join Discord for the latest updates

[!IMPORTANT] Open an issue before starting work on a PR.

If there's a feature you'd like to add or a bug you've found, please open a GitHub issue with a high-level sketch of your plan. This lets us give feedback on the approach before you invest the effort, saving everyone time and increasing the chance your change lands.

There are many reasons a PR may not be mergeable — design fit, scope, compatibility, planned refactors, etc. — and these are often hard to spot from the outside, especially for a first-time contributor.

Citation

You can read our paper explaining TabPFNv2 here, and model reports for TabPFN-2.5 and TabPFN-3.

BibTeX
…

Usage Tips

  • Use batch prediction mode: Each predict call recomputes the training set. Calling predict on 100 samples separately is almost 100 times slower and more expensive than a single call. If the test set is very large, split it into chunks of 1000 samples each.
  • Avoid data preprocessing: Do not apply data scaling or one-hot encoding when feeding data to the model.
  • Use a GPU: TabPFN is slow to execute on a CPU. Ensure a GPU is available for better performance.
  • Mind the dataset size: TabPFN works best on datasets within its recommended size limits. TabPFN-3.5 and TabPFN-3.5-Fast accept up to 1,000,000 rows and 20,000 features. See the Models page for the limits of other checkpoints.

❓ FAQ

Usage & Compatibility

Q: What dataset sizes work best with TabPFN?

Recommended row and feature limits vary by checkpoint — see the Models page for the per-release limits. As a quick reference, the current default (TabPFN-3.5, and TabPFN-3.5-Fast) accepts up to 1,000,000 rows and 20,000 features. If your dataset exceeds the recommended limits for your checkpoint, you can subsample, set ignore_pretraining_limits=True to push past the size guardrail, or upgrade to a release with a higher limit.

Q: Why can't I use TabPFN with Python 3.9?

TabPFN requires Python 3.10+ due to newer language features. Compatible versions: 3.10, 3.11, 3.12, 3.13, 3.14.

Installation & Setup

Q: How do I get access to TabPFN-2.5 / TabPFN-2.6 / TabPFN-3 / TabPFN-3.5?

On first use, TabPFN will automatically open a browser window where you can log in via PriorLabs and accept the license terms. Your authentication token is cached locally so you only need to do this once.

For headless / CI environments where a browser is not available, visit https://ux.priorlabs.ai, go to the License tab to accept the license, and then set the TABPFN_TOKEN environment variable with a token obtained from your account.

If access via the browser-based flow is not an option for you, please contact us at [email protected].

Q: How do I use TabPFN without an internet connection?

TabPFN automatically downloads model weights when first used. For offline usage:

Using the Provided Download Script

If you have the TabPFN repository, you can use the included script to download all models (including ensemble variants):

# After installing TabPFN
python scripts/download_all_models.py

This script will download the main classifier and regressor models, as well as all ensemble variant models to your system's default cache directory.

Manual Download

  1. Download the model files manually from HuggingFace:

    • TabPFN-3.5 (one file serves both classifier and regressor): tabpfn-v3.5-20260909.safetensors
    • TabPFN-3.5-Fast: tabpfn-v3.5-fast-20260909.safetensors
  2. Place the file in one of these locations:

    • Specify directly: TabPFNClassifier(model_path="/path/to/model.ckpt")
    • Set environment variable: export TABPFN_MODEL_CACHE_DIR="/path/to/dir" (see environment variables FAQ below)
    • Default OS cache directory:
      • Windows: %APPDATA%\tabpfn\
      • macOS: ~/Library/Caches/tabpfn/
      • Linux: ~/.cache/tabpfn/
Q: I'm getting a pickle error when loading the model. What should I do?

Try the following:

  • Download the newest version of tabpfn pip install tabpfn --upgrade
  • Ensure model files downloaded correctly (re-download if needed)
Q: What environment variables can I use to configure TabPFN?

TabPFN uses Pydantic settings for configuration, supporting environment variables and .env files:

Authentication:

  • TABPFN_TOKEN: Provide a PriorLabs authentication token directly (useful for headless/CI environments). Obtain one from [https://ux.priorlab

GitHub Issues· 0 开放

在 GitHub 查看全部

暂无开放 Issues,或尚未同步最近议题。

核心特点

  • •TabPFN Client
  • •TabPFN Extensions
  • •interpretability: Gain insights with SHAP-based explanations, feature importance, and selection tools.
  • •unsupervised: Tools for outlier detection and synthetic tabular data generation.
  • •embeddings: Extract and use TabPFN's internal learned embeddings for downstream tasks or analysis.
  • •many_class: Handle multi-class classification problems that exceed TabPFN's built-in class limit.
  • •TabPFN (this repo)
  • •TabPFN UX
  • •Commercial Support: Includes a Commercial Enterprise License for production use-cases, dedicated integration support, and access to private high-speed inference engines.
  • •Join our Discord Community

> 标签

Pythondata-sciencefoundation-modelsmachine-learningtabpfn

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理