WeightedPFN / README.md
xiajunwen's picture
WeightedPFN (TabPFN-3.5 with weighted attention, 800-step missing-data fine-tune)
70d0c5f verified
|
Raw History Blame Contribute Delete
6.23 kB
---
license: other
license_name: tabpfn-3.5-non-commercial-license
license_link: LICENSE
inference: false
base_model: Prior-Labs/tabpfn_3_5
base_model_relation: finetune
tags:
- tabular-classification
- tabular-regression
- weightedpfn
- tabpfn
- in-context-learning
- missing-data
- sample-weights
extra_gated_heading: Accept the TabPFN-3.5 Non-Commercial License to access these weights
extra_gated_prompt: >-
These weights are a Derivative of the TABPFN-3.5 Model of Prior Labs GmbH. They are distributed under the
TABPFN-3.5 Non-Commercial License (see LICENSE and NOTICE in this repository) and are not an official
Prior Labs product. Any rights to use them are granted directly by Prior Labs GmbH under that License.
extra_gated_fields:
I will use these weights only for Non-Commercial Purposes as defined in the license in the LICENSE file: checkbox
I will not offer these weights as part of a hosted, managed, API or SaaS service: checkbox
I have read and agree to the license in the LICENSE file: checkbox
extra_gated_button_content: Agree and access
---
# WeightedPFN
**Tabular foundation models for weighted regression and weighted classification.**
Weights for the paper *Tabular Foundation Models for Weighted Regression and Classification*
(Junwen Xia, Yan He, Dehan Kong and Zhenhua Lin). Code: https://github.com/xiajunwen1007/WeightedPFN
**Weighted regression** and **weighted classification** have applications ranging from missing-data analysis and
causal inference to insurance pricing and particle physics. Existing weighted methods must be fitted and tuned on each
dataset, which is costly for flexible nonlinear learners. Tabular foundation models such as TabPFN-3.5 avoid this cost
by predicting on a new dataset in a single forward pass, but they cannot use sample weights. We propose WeightedPFN,
which adapts TabPFN-3.5 to weighted prediction through weighted attention, a normalized weighted loss, and pretraining
on synthetic weighted prediction tasks from missing-data problems. It performs strongly on real missing-data and
out-of-distribution causal tasks while running about as fast as linear baselines.
> **License.** WeightedPFN is built on TabPFN-3.5 and may be used only for non-commercial purposes under the
> TabPFN-3.5 Non-Commercial License. It is not an official Prior Labs product. See [License](#license).
![WeightedPFN pretraining pipeline](assets/weightedpfn_pipeline.png)
## Files
- `weightedpfn-v3.5-regressor.safetensors`: network for weighted regression (FP32, 876 MB)
- `weightedpfn-v3.5-classifier.safetensors`: network for weighted classification (FP32, 876 MB)
## Usage
Install the code from [GitHub](https://github.com/xiajunwen1007/WeightedPFN) (requires `tabpfn==9.2.0`), accept the
license on this page, and log in with `hf auth login`. The weights are downloaded automatically on first use:
```python
from weightedpfn import WeightedPFNClassifier, WeightedPFNRegressor
# Weighted regression
reg = WeightedPFNRegressor(device="auto")
reg.fit(X_train, y_train, sample_weight=w_train)
y_pred = reg.predict(X_test)
# Weighted classification
clf = WeightedPFNClassifier(device="auto")
clf.fit(X_train, y_train, sample_weight=w_train)
proba = clf.predict_proba(X_test)
```
## License
WeightedPFN is a Derivative of the TABPFN-3.5 Model of Prior Labs GmbH: the weights were fine-tuned from TabPFN-3.5,
and the code in `weightedpfn/` modifies the TabPFN-3.5 architecture at run time. The weights in this repository and the
accompanying code are therefore distributed under the **TABPFN-3.5 Non-Commercial License v1.0** (`LICENSE`). Any rights to use
them are granted to you directly by Prior Labs GmbH under that License; by downloading or using them you agree to its
terms. Please read the License before use. In particular:
- **Non-commercial use only.** The model may be used only for testing, evaluation or research not tied to commercial
gain, production deployment or revenue generation. Its outputs (predictions, probabilities and other results) may also
be used only for such non-commercial purposes. Commercial or production use requires a commercial license from Prior
Labs (sales@priorlabs.ai).
- **No hosted service.** The model may not be offered as part of a hosted, managed, API or SaaS service, whether paid or
free.
- **Redistribution.** Copies of the weights or code must include `LICENSE`, `LICENSE-Apache-2.0` and `NOTICE`, and
may not suggest that they are an official Prior Labs product.
- **Other restrictions.** Section 4 of the License also excludes, among others, military, surveillance and biometric
processing purposes.
**Third-party code.** `weightedpfn/_patch.py` adapts code from the `tabpfn` package (version 9.2.0, Copyright (c)
2026 Prior Labs GmbH), which is licensed under the Apache License 2.0; see `LICENSE-Apache-2.0` and `NOTICE`.
**Not an official product.** WeightedPFN is not an official product of Prior Labs GmbH and has not been endorsed,
approved or validated by Prior Labs GmbH.
**Attribution notice** (Section 3(b) of the License; also in `NOTICE`):
```text
The TABPFN-3.5 Model is licensed by Prior Labs GmbH under the TABPFN-3.5 Non-Commercial License.
Copyright © Prior Labs GmbH 2026.
THE SERVICES ARE PROVIDED FREE OF CHARGE: COMPANY SHALL NOT BE LIABLE FOR DAMAGES RESULTING FROM SLIGHT NEGLIGENCE.
LIABILITY FOR GROSS NEGLIGENCE AND INTENTIONAL MISCONDUCT REMAINS UNAFFECTED.
We have modified the TABPFN-3.5 Model: WeightedPFN was fine-tuned from the TabPFN-3.5 weights (checkpoint
tabpfn-v3.5-20260909), and its code changes the TabPFN-3.5 attention and column preprocessing so that training rows
can carry sample weights.
```
**Disclaimer.** WeightedPFN is provided "as is", without warranties of any kind, express or implied. To the extent
permitted by law, the authors and Prior Labs GmbH are not liable for any damages arising from its use; the limitation of
liability in Section 5 of the License applies.
## Citation
```bibtex
@misc{xia2026weightedpfn,
title = {Tabular Foundation Models for Weighted Regression and Classification},
author = {Xia, Junwen and He, Yan and Kong, Dehan and Lin, Zhenhua},
year = {2026},
note = {Preprint}
}
```