Mitra-v2 classifier weights and model card
Browse files- README.md +88 -0
- config.json +1 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: tabular-classification
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# Mitra-v2 Classifier
|
| 7 |
+
|
| 8 |
+
Mitra-v2 classifier is a tabular foundation model that is pre-trained on purely synthetic datasets sampled from a mix of random classifiers, including the new Hybrid SCM prior. It is the second generation of the Mitra classifier ([autogluon/mitra-classifier](https://huggingface.co/autogluon/mitra-classifier)), pre-trained with a 10x longer context, three times as many features, and an improved optimizer. On the TabArena and TALENT benchmarks it delivers state-of-the-art accuracy at the level of TabFM and EXAONE Tabular, while surpassing TabPFN-3 by a wide margin. The regression model is at [autogluon/mitra-regressor-2](https://huggingface.co/autogluon/mitra-regressor-2), and the inference and fine-tuning code with our evaluation results is at [autogluon/mitra-finetune](https://huggingface.co/autogluon/mitra-finetune).
|
| 9 |
+
|
| 10 |
+
## Architecture
|
| 11 |
+
|
| 12 |
+
Mitra-v2 is based on a 12-layer 2D Transformer of 75.7 M parameters (attention across rows and across columns), pre-trained by incorporating an in-context learning paradigm. The architecture is unchanged from Mitra-v1; the gains come from the scaled-up synthetic pre-training distribution and the optimizer.
|
| 13 |
+
|
| 14 |
+
## Usage
|
| 15 |
+
|
| 16 |
+
To use Mitra-v2 classifier, install AutoGluon and the `mitra-finetune` package by running:
|
| 17 |
+
|
| 18 |
+
```sh
|
| 19 |
+
pip install uv
|
| 20 |
+
uv pip install "autogluon.tabular[mitra]>=1.6" "tabarena>=0.1.0"
|
| 21 |
+
uv pip install git+https://huggingface.co/autogluon/mitra-finetune
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
A minimal example showing how to fine-tune and predict with the Mitra-v2 classifier using the same recipe as our reported results (50-step fine-tuning with 8-fold bagging). The recipe fine-tunes and bags eight copies of the model and requires a CUDA GPU; each `predict_proba` or `predict` call runs one bagged fine-tune:
|
| 25 |
+
|
| 26 |
+
```python
|
| 27 |
+
import pandas as pd
|
| 28 |
+
from sklearn.model_selection import train_test_split
|
| 29 |
+
from sklearn.datasets import load_wine
|
| 30 |
+
from huggingface_hub import snapshot_download
|
| 31 |
+
from mitra_finetune import MitraFinetune
|
| 32 |
+
|
| 33 |
+
# Load dataset
|
| 34 |
+
wine_data = load_wine()
|
| 35 |
+
X = pd.DataFrame(wine_data.data, columns=wine_data.feature_names)
|
| 36 |
+
y = pd.Series(wine_data.target, name="target")
|
| 37 |
+
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42, stratify=y)
|
| 38 |
+
|
| 39 |
+
# Download the Mitra-v2 classifier weights
|
| 40 |
+
ckpt_dir = snapshot_download("autogluon/mitra-classifier-2")
|
| 41 |
+
|
| 42 |
+
# Fine-tune and predict
|
| 43 |
+
model = MitraFinetune(checkpoint_dir=ckpt_dir, problem_type="classification")
|
| 44 |
+
model.fit(X_train, y_train)
|
| 45 |
+
proba = model.predict_proba(X_test)
|
| 46 |
+
pred = proba.argmax(axis=1)
|
| 47 |
+
print("Accuracy:", (pred == y_test.values).mean())
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
A minimal example showing how to perform inference with the Mitra-v2 classifier directly in AutoGluon (the weights are a drop-in replacement for the Mitra-v1 classifier):
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from autogluon.tabular import TabularDataset, TabularPredictor
|
| 54 |
+
|
| 55 |
+
train_data = TabularDataset(pd.concat([X_train, y_train], axis=1))
|
| 56 |
+
test_data = TabularDataset(pd.concat([X_test, y_test], axis=1))
|
| 57 |
+
|
| 58 |
+
mitra_predictor = TabularPredictor(label="target")
|
| 59 |
+
mitra_predictor.fit(
|
| 60 |
+
train_data,
|
| 61 |
+
hyperparameters={
|
| 62 |
+
"MITRA": {"hf_model": "autogluon/mitra-classifier-2", "fine_tune": False}
|
| 63 |
+
},
|
| 64 |
+
)
|
| 65 |
+
|
| 66 |
+
mitra_predictor.leaderboard(test_data)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Set `"fine_tune": True` to fine-tune inside AutoGluon. Note that AutoGluon's stock defaults differ from the `mitra-finetune` recipe used for the reported benchmark numbers.
|
| 70 |
+
|
| 71 |
+
## License
|
| 72 |
+
|
| 73 |
+
This project is licensed under the Apache-2.0 License.
|
| 74 |
+
|
| 75 |
+
## Reference
|
| 76 |
+
|
| 77 |
+
Mitra-v2 Technical Report (Amazon, 2026). The arXiv link will be added once the report is public.
|
| 78 |
+
|
| 79 |
+
```
|
| 80 |
+
@article{zhang2025mitra,
|
| 81 |
+
title={Mitra: Mixed synthetic priors for enhancing tabular foundation models},
|
| 82 |
+
author={Zhang, Xiyuan and Maddix, Danielle C and Yin, Junming and Erickson, Nick and Ansari, Abdul Fatir and Han, Boran and Zhang, Shuai and Akoglu, Leman and Faloutsos, Christos and Mahoney, Michael W and others},
|
| 83 |
+
journal={arXiv preprint arXiv:2510.21204},
|
| 84 |
+
year={2025}
|
| 85 |
+
}
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
Amazon Science blog: [Mitra: Mixed synthetic priors for enhancing tabular foundation models](https://www.amazon.science/blog/mitra-mixed-synthetic-priors-for-enhancing-tabular-foundation-models)
|
config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dim": 512, "dim_output": 10, "n_layers": 12, "n_heads": 4, "task": "CLASSIFICATION"}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ffab0e2cf52f61c5b7c7eb1e8542996736d1023a0212190cc09abc2119a1e09
|
| 3 |
+
size 302717904
|