Views
No views yet
🏆 SOTA result: ROC-AUC = 0.9970, Accuracy = 98.07% (5-fold stratified CV), ranking #1 ahead of every tuned gradient-boosting baseline.
RepeatedStratifiedKFold, seed 42, single fixed config per model, no tuning on test.| Rank | Model | ROC-AUC | Accuracy | CV Folds | Time (s) |
|---|---|---|---|---|---|
| 🥇 1 | TabPFNv2 (this model, CPU) | 0.9970 ± 0.0039 | 0.9807 ± 0.0116 | 5×1 | 214.8 |
| 🥈 2 | Logistic Regression (standardized) | 0.9947 ± 0.0077 | 0.9778 ± 0.0169 | 10×3 | 10.9 |
| 🥉 3 | CatBoost | 0.9939 ± 0.0084 | 0.9707 ± 0.0228 | 10×3 | 91.0 |
| 4 | LightGBM | 0.9934 ± 0.0084 | 0.9672 ± 0.0206 | 10×3 | 60.6 |
| 5 | XGBoost | 0.9933 ± 0.0088 | 0.9661 ± 0.0256 | 10×3 | 60.1 |
| 6 | HistGradientBoosting | 0.9919 ± 0.0107 | 0.9608 ± 0.0278 | 10×3 | 70.9 |
| 7 | RandomForest | 0.9905 ± 0.0129 | 0.9596 ± 0.0276 | 10×3 | 75.4 |
| Library | Version |
|---|---|
| tabpfn | 2.0.9 |
| scikit-learn | 1.6.1 |
| xgboost | 3.2.0 |
| lightgbm | 4.6.0 |
| catboost | 1.2.10 |
| Python | 3.12 |
1import pickle
2from huggingface_hub import hf_hub_download
3from sklearn.datasets import load_breast_cancer
4from sklearn.model_selection import train_test_split
5from sklearn.metrics import roc_auc_score, accuracy_score
6
7# Load the fitted model
8path = hf_hub_download("AurelPx/tabpfnv2-ultimate-breast-cancer-detection", "tabpfnv2_wdbc.pkl")
9clf = pickle.load(open(path, "rb"))
10
11# Evaluate on the same holdout split (seed 42)
12X, y = load_breast_cancer(return_X_y=True)
13X = X.astype("float32")
14_, Xte, _, yte = train_test_split(X, y, test_size=0.25, random_state=42, stratify=y)
15
16proba = clf.predict_proba(Xte)[:, 1]
17print("AUC", roc_auc_score(yte, proba)) # ~0.998
18print("ACC", accuracy_score(yte, proba > 0.5)) # ~0.972pip install tabpfn==2.0.9 scikit-learn huggingface_hub.
On first use TabPFNv2 weights are fetched from the Hub (no license token required for 2.0.9).
For CPU, the script sets TABPFN_ALLOW_CPU_LARGE_DATASET=1 and device="cpu".1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "AurelPx/tabpfnv2-ultimate-breast-cancer-detection"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)AutoModelForCausalLM with the appropriate AutoModel class.