metadata
pipeline_tag: tabular-classification
ShapPFN
ShapPFN is a foundation model for tabular data that integrates Shapley value regression directly into its architecture, producing both predictions and explanations in a single forward pass. On standard benchmarks, ShapPFN achieves competitive performance while producing high-fidelity explanations ($R^2 \approx 0.96$, cosine $\approx 0.99$) over 1000x faster than KernelSHAP.
- Paper: Real-Time Explanations for Tabular Foundation Models
- GitHub Repository: kunumi/ShapPFN
Architecture
ShapPFN combines several key components:
- PFN-style tabular transformers: Uses alternating attention over rows and features (similar to TabPFN / nanoTabPFN).
- Additive decomposition: Separate decoder heads for
baseand per-feature contributions. - Shapley value regression: Training explanations as part of the model output (ViaSHAP-style) rather than as a post-hoc procedure.
Setup
To use the code and the model from the official repository, you can install it via:
pip install -e .
Quickstart
The official repository provides scripts for various tasks:
- Data Generation:
bash scripts/generate_data.sh - Training:
bash scripts/train_shappfn.sh - Evaluation:
bash scripts/eval_openml.sh(OpenML suite) andbash scripts/eval_shap.sh(KernelExplainer comparison)