8,348
stars
+0+1+195
812
forks
45
watchers
–
prs
–
issues
30
releases
–
discussions
README
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 bash 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, TabPFN-3.5 and TabPFN-3.5-Fast 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, bash 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: python 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". python 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): python 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: bash