- See which features drive model predictions.
- Compare feature importance across samples.
- Detect feature interactions.
- Debug unexpected model behavior.
Why TabPFN is Well-Suited for Interpretability
TabPFN produces smooth, well-calibrated predictions that make post-hoc explanations more stable and meaningful. Because it is a foundation model pretrained on synthetic data, it generalizes without overfitting to individual training samples — so feature attributions reflect genuine patterns. TabPFN follows the scikit-learn estimator API (fit, predict, predict_proba), which means it works out of the box with most interpretability tools in the sklearn ecosystem — partial dependence plots, permutation importance, and any other method that accepts a sklearn-compatible estimator. No wrappers or adapters needed.

Installation
shapiq and the other dependencies needed for all methods. To
run against the cloud API instead of locally, install
tabpfn-client in place of tabpfn:
Quickstart
Train a model, explain a single prediction, and plot the result:This tutorial runs TabPFN locally, which requires a GPU — see our FAQ
for GPU setup. The recommended
get_tabpfn_imputation_explainer relies on
fit_mode="fit_with_cache", which is local-only and not available in the
tabpfn_client backend. To use the cloud API, replace the tabpfn import with
tabpfn_client and remove fit_mode (the client does not support it yet).Choosing a Method
Before diving into each method, here is a summary to help you pick the right tool for the question you are trying to answer.
If you are still unsure which method to use, follow the table below to see the best tools for most common questions.
Use Cases
Explain a prediction with shapiq
Use Shapley interaction indices to understand not just which features matter, but which feature pairs drive a prediction together.- Classification
- Regression
predict_proba to a
shap explainer directly when you run TabPFN locally and reuse the same values for both the global beeswarm
above and per-sample waterfalls (pip install shap):


Explain many rows with the cloud API
Withtabpfn_client, use tabpfn_client.explain.permutation_shap. It sends
the rows of many explanations in each API request, and it gives the same plots
as the example above.
shap.PermutationExplainer with tabpfn_client, as it
calls the model about two times for each explained row. Each call is one API
request, so 1,000 rows need about 2,000 requests and can take more than 20
minutes.
Requests, cost and settings
Requests, cost and settings
Requests. By default, each request has at most 50,000 rows, and fewer when
the API accepts fewer. Larger requests cost more tokens per row. Set
To estimate the tokens before you start, price one full request with
batch_size to change it.Fit the model with the default fit_mode. With fit_mode="fit_with_cache",
each request has at most 10,000 rows, so permutation_shap needs more requests
and is slower. It gives a warning in that case.Cost. Each predicted row counts toward your
usage. The number of
rows is at most:estimate_cost and multiply by the number of requests:Visualize global feature effects with Partial Dependence Plots
PDP and ICE curves show how a feature affects predictions across the whole dataset, not just one sample.- Classification
- Regression

The remove-and-recontextualize alternative
get_tabpfn_explainer uses the remove-and-recontextualize paradigm (Rundel et
al. 2024): TabPFN is re-fit for every coalition, so the KV cache cannot be
reused — expect this path to be substantially slower than the recommended
get_tabpfn_imputation_explainer. Reach for it when you specifically want this
paradigm. It also takes the training labels and does not need fit_mode.
Feature selection
Sequential feature selection identifies the minimal subset of features that contributes most to model performance:Controlling the budget parameter
Thebudget parameter in explainer.explain() sets how many coalition samples
shapiq evaluates to approximate Shapley values. Each coalition is a subset of
features — evaluating more of them produces more accurate estimates but costs
more model calls.
In theory, exact Shapley values require evaluating all 2^n feature subsets
(e.g. 1024 for 10 features, ~1 billion for 30). In practice, shapiq’s
approximation algorithms converge well before that:
Start low (e.g.
budget=128) and increase only if the resulting explanations
look noisy or unstable across repeated runs.
Library Reference
See the Interpretability reference for generated signatures, parameter tables, return types, and links to the classes that accept forwarded keyword arguments.get_tabpfn_imputation_explainerget_tabpfn_inf_explainerget_tabpfn_explainerpartial_dependence_plotsfeature_selectionFeatureSelectionResultshapiq_to_shap_explanationget_decoder_readoutclass_voteplot_decoder_readout
FAQ
GPU setup, batch inference, and performance tuning.
Classification
Binary and multi-class classification guide.
Regression
Point estimates, quantiles, and full distributions.
Fine-Tuning
Adapt TabPFN to your domain-specific data.