Metadata-Version: 2.5
Name: dashai-tabicl
Version: 0.1.0
Summary: Adds the TabICLv2 tabular foundation model to DashAI for tabular classification and regression without training.
Project-URL: Homepage, https://github.com/Irozuku/dashai-tabicl
Project-URL: Issues, https://github.com/Irozuku/dashai-tabicl/issues
Project-URL: DashAI, https://github.com/DashAISoftware/DashAI
Author: Emilio Diaz
License-Expression: MIT
License-File: LICENSE
Keywords: DashAI,Model
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Requires-Dist: dashai>=0.11.0
Requires-Dist: numpy
Requires-Dist: tabicl>=2.2
Requires-Dist: torch>=2.6
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# TabICLv2 for DashAI

dashai-tabicl adds TabICLv2, an open tabular foundation model, to DashAI. Its two components, `TabICLClassifier` for tabular classification and `TabICLRegression` for regression, predict from the training rows in one pass, without gradient training or tuning, and download their BSD licensed weights through DashAI.

## Included components

| Component | Display name | Task | Library | Checkpoint | Download size |
| --- | --- | --- | --- | --- | --- |
| `TabICLClassifier` | TabICLv2 classifier | `TabularClassificationTask` | `tabicl.TabICLClassifier` | [tabicl-classifier-v2-20260212.ckpt](https://huggingface.co/jingang/TabICL) | 110 MB |
| `TabICLRegression` | TabICLv2 regression | `RegressionTask` | `tabicl.TabICLRegressor` | [tabicl-regressor-v2-20260212.ckpt](https://huggingface.co/jingang/TabICL) | 114 MB |

## Requirements

- DashAI 0.11.0 or newer.
- About 110 MB of free disk space for the classifier weights and 114 MB for the regression weights.
- Table size: the TabICL authors report excellent results with 300 to 100,000 training rows and up to 2,000 features. TabICLv2 was pretrained on tables with 300 to 48,000 training rows, and it was not tested below 300 rows. More than 10 classes are handled by its many class mode.
- CPU works for small and medium tables; a CUDA GPU is much faster. The `device` choice lists CUDA GPUs only when PyTorch is installed with CUDA support, so Apple Silicon and Intel GPUs run on the CPU in DashAI.
- Installing the plugin adds only the `tabicl` package (pure Python, about 0.3 MB); everything it needs already ships with DashAI.

## Installation

Install the plugin from the Plugins page in DashAI, or install it into the Python environment that runs DashAI and restart DashAI:

```
pip install dashai-tabicl
```

## Downloading the weights

Each model card in DashAI has a download control that does the same as `POST /api/v1/component/<Name>/download`, for example `POST /api/v1/component/TabICLClassifier/download`. The checkpoint goes to `<DashAI data folder>/components/<ClassName>/TabICL/`, for example `~/.DashAI/components/TabICLClassifier/TabICL/tabicl-classifier-v2-20260212.ckpt`. The same control deletes it. A run cannot start until its model is downloaded, and the models never download anything on their own.

The checkpoints are open, so no Hugging Face account or token is needed.

## How it predicts

- Training stores the training rows, after DashAI encodes the categorical columns, and loads the weights. Nothing is fitted by gradient descent.
- Every prediction runs the transformer over the training rows together with the rows to predict. DashAI scores the train, validation and test partitions, and explainers such as `KernelShap`, `PartialDependence` and `DiceCounterfactual` call the model many times, so explanations are slow on the CPU.
- Metrics on the train partition are optimistic, because those rows are part of the context.
- A saved run keeps the training rows and the encoders but not the weights, so it stays small (about 300 KB for 400 breast cancer rows). Reopening it reads the weights from the component folder of the DashAI that opens it, which must have the model downloaded.

## References

Model card and code:

- TabICLv2 model card and checkpoints. Hugging Face repository jingang/TabICL, 2026. https://huggingface.co/jingang/TabICL
- Soda team at Inria. tabicl, the official TabICL code with its scikit-learn interface. GitHub, 2025. https://github.com/soda-inria/tabicl

Papers:

1. Jingang Qu, David Holzmüller, Gaël Varoquaux and Marine Le Morvan. TabICL: A Tabular Foundation Model for In-Context Learning on Large Data. In Proceedings of the 42nd International Conference on Machine Learning (ICML), PMLR volume 267, pages 50817 to 50847, 2025. [PMLR](https://proceedings.mlr.press/v267/qu25d.html), [arXiv:2502.05564](https://arxiv.org/abs/2502.05564). The column then row embedding and the in context learning transformer that TabICL is built on.

```bibtex
@InProceedings{pmlr-v267-qu25d,
  title = 	 {{T}ab{ICL}: A Tabular Foundation Model for In-Context Learning on Large Data},
  author =       {Qu, Jingang and Holzm\"{u}ller, David and Varoquaux, Ga\"{e}l and Le Morvan, Marine},
  booktitle = 	 {Proceedings of the 42nd International Conference on Machine Learning},
  pages = 	 {50817--50847},
  year = 	 {2025},
  editor = 	 {Singh, Aarti and Fazel, Maryam and Hsu, Daniel and Lacoste-Julien, Simon and Berkenkamp, Felix and Maharaj, Tegan and Wagstaff, Kiri and Zhu, Jerry},
  volume = 	 {267},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {13--19 Jul},
  publisher =    {PMLR},
  pdf = 	 {https://raw.githubusercontent.com/mlresearch/v267/main/assets/qu25d/qu25d.pdf},
  url = 	 {https://proceedings.mlr.press/v267/qu25d.html},
}
```

2. Jingang Qu, David Holzmüller, Gaël Varoquaux and Marine Le Morvan. TabICLv2: A Better, Faster, Scalable, and Open Tabular Foundation Model. In Proceedings of the 43rd International Conference on Machine Learning (ICML), PMLR volume 306, pages 102477 to 102555, 2026. [PMLR](https://proceedings.mlr.press/v306/qu26a.html), [arXiv:2602.11139](https://arxiv.org/abs/2602.11139). The v2 model and the classification and regression checkpoints both components download.

```bibtex
@InProceedings{pmlr-v306-qu26a,
  title = 	 {{T}ab{ICL}v2: A Better, Faster, Scalable, and Open Tabular Foundation Model},
  author =       {Qu, Jingang and Holzm\"{u}ller, David and Varoquaux, Ga\"{e}l and Le Morvan, Marine},
  booktitle = 	 {Proceedings of the 43rd International Conference on Machine Learning},
  pages = 	 {102477--102555},
  year = 	 {2026},
  editor = 	 {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto},
  volume = 	 {306},
  series = 	 {Proceedings of Machine Learning Research},
  month = 	 {06--11 Jul},
  publisher =    {PMLR},
  pdf = 	 {https://raw.githubusercontent.com/mlresearch/v306/main/assets/qu26a/qu26a.pdf},
  url = 	 {https://proceedings.mlr.press/v306/qu26a.html},
}
```

## Parameters

### TabICLClassifier

| Name | Type | Default | Allowed range or choices | Meaning |
| --- | --- | --- | --- | --- |
| `n_estimators` | integer | 8 | 1 to 32 | Number of ensemble members averaged for each prediction. |
| `softmax_temperature` | float | 0.9 | greater than 0, at most 2 | Temperature that divides the logits before the softmax. |
| `average_logits` | boolean | true | true or false | Average the logits of the ensemble members instead of their probabilities. |
| `outlier_threshold` | float | 4 | greater than 0, at most 20 | Z score above which a feature value counts as an outlier and is clipped before inference. |
| `batch_size` | integer | 8 | 1 to 64 | Number of ensemble members processed together. |
| `random_state` | integer | 42 | at least 0 | Seed for the shuffles that build the ensemble members, so predictions can be repeated. |
| `device` | choice | first detected GPU, else CPU | `CPU` or a detected GPU | Device the model runs on. |

A DashAI optimizer can search `n_estimators` from 4 to 16 and `softmax_temperature` from 0.5 to 1.5.

### TabICLRegression

| Name | Type | Default | Allowed range or choices | Meaning |
| --- | --- | --- | --- | --- |
| `n_estimators` | integer | 8 | 1 to 32 | Number of ensemble members averaged for each prediction. |
| `outlier_threshold` | float | 4 | greater than 0, at most 20 | Z score above which a feature value counts as an outlier and is clipped before inference. |
| `batch_size` | integer | 8 | 1 to 64 | Number of ensemble members processed together. |
| `random_state` | integer | 42 | at least 0 | Seed for the shuffles that build the ensemble members, so predictions can be repeated. |
| `device` | choice | first detected GPU, else CPU | `CPU` or a detected GPU | Device the model runs on. |

A DashAI optimizer can search `n_estimators` from 4 to 16.

## Development

Run the tests and build the package from the plugin repository in its own virtual environment, never in DashAI's (Windows commands shown):

```
uv venv --python 3.12
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install -e ".[test]"
.venv\Scripts\python -m pytest -q
uv build
```

The default run never downloads weights: it runs tabicl on tiny random checkpoints. `.venv\Scripts\python -m pytest -q -m weights` downloads both checkpoints (about 224 MB) and checks real predictions on the breast cancer and diabetes datasets.

## License

The plugin code is released under the MIT license, see LICENSE.

The model weights have their own license:

- TabICL checkpoints in [jingang/TabICL](https://huggingface.co/jingang/TabICL): BSD 3 Clause license, per the model card.

The dependencies whose license differs from MIT:

- [tabicl](https://github.com/soda-inria/tabicl): BSD 3 Clause license, copyright the Soda team at Inria.
- [PyTorch](https://github.com/pytorch/pytorch) (`torch`): BSD 3 Clause license; its wheels also bundle third party code under their own licenses.
- [NumPy](https://github.com/numpy/numpy): BSD 3 Clause license; its wheels also bundle code under the 0BSD, MIT, Zlib and CC0 1.0 licenses.
