Views
No views yet
| File | Description | Epochs | Val ROC-AUC | Val PR-AUC |
|---|---|---|---|---|
tabpfn-sdm-nonspatial.pt | Standard (non-spatial) train/test evaluation | 100 | 0.747 | 0.261 |
tabpfn-sdm-spatial.pt | Spatially-separated train/test evaluation | 50 | 0.653 | 0.144 |
disdat R package (standardized presence-only and presence-absence datasets)Prior-Labs/TabPFN-v2-clf)1import torch
2from tabpfn import TabPFNClassifier
3from huggingface_hub import hf_hub_download
4
5# Download model
6model_path = hf_hub_download(
7 repo_id="rdinnager/tabpfn-sdm-finetuned",
8 filename="tabpfn-sdm-nonspatial.pt"
9)
10
11# Load finetuned model
12device = "cuda" if torch.cuda.is_available() else "cpu"
13clf = TabPFNClassifier(
14 ignore_pretraining_limits=True,
15 device=device,
16 n_estimators=8,
17 random_state=32639
18)
19clf._initialize_model_variables()
20
21checkpoint = torch.load(model_path, map_location=device, weights_only=False)
22clf.models_[0].load_state_dict(checkpoint["model_state_dict"])
23clf.models_[0].eval()
24
25# Fit on training data and predict
26clf.fit(X_train, y_train)
27probs = clf.predict_proba(X_test)[:, 1] # Probability of presence1source("R/run_tabpfn_finetuned.R")
2
3result <- run_tabpfn_finetuned_ensemble(
4 train_dat = train_data,
5 test_dat = test_data,
6 model_path = "tabpfn-sdm-nonspatial.pt",
7 max_train_size = 1000L,
8 n_estimators = 8L
9)
10
11# result$test contains y_truth and y_pred columnsrun_tabpfn_finetuned_ensemble() (R) or can be replicated in Python using the utilities in the GitHub repo..pt file is a PyTorch checkpoint dictionary containing:| Key | Description |
|---|---|
model_state_dict | Finetuned TabPFN model weights |
config | Training configuration (hyperparameters, data settings) |
history | Training history (loss, metrics per epoch) |
step1_path | Path to the Step 1 model used as initialization |
tabpfn Python package (v2) for inference1@article{dinnage2026niche,
2 title={A Niche in the Machine: The Promise of AI Foundation Models for Species Distribution Modeling},
3 author={Dinnage, Russell and Warren, Dan L.},
4 year={2026},
5 doi={10.32942/X2VQ10},
6 journal={EcoEvoRxiv},
7 url={https://ecoevorxiv.org/repository/view/11797/}
8}1@article{hollmann2025tabpfn,
2 title={Accurate Predictions on Small Data with a Tabular Foundation Model},
3 author={Hollmann, Noah and M{\"u}ller, Samuel and Purucker, Lennart and
4 Krishnakumar, Arjun and K{\"o}rfer, Max and Hoo, Shi Bin and
5 Schirrmeister, Robin Tibor and Hutter, Frank},
6 journal={Nature},
7 year={2025},
8 publisher={Nature Publishing Group}
9}