TabFM#

class sdm.models.TabFM(task: Task | str | Iterable[Task | str] | None, pretrained: bool = True, accept_license: bool = False, device: device | str | None = None)#

Bases: ICLModel

The tabular foundation model from “Introducing TabFM: A Zero-shot Foundation Model for Tabular Data”.

../../_images/tabfm_light.png
../../_images/tabfm_dark.png

Architecturally, TabFM can be viewed as a scaled-up TabICLv2-style model with Fourier cell embeddings, separate numerical and categorical cell projections, two repeated column/row interaction stages, RMSNorm-based transformer blocks and SwiGLU feed-forward blocks.

Note

TabFM model weights are distributed under the TabFM Non-Commercial License v1.0. Before downloading pretrained weights, users must accept the license either interactively when prompted or explicitly via accept_license=True.

Parameters:
  • task (TaskLike | Iterable[TaskLike] | None) – The tasks to initialize. If None, all tasks supported by this model are initialized. Pass a single task to avoid initializing separate ~1.6B parameter models.

  • pretrained (bool) – Whether to load the pretrained checkpoint.

  • accept_license (bool) – Whether to accept the TabFM Non-Commercial License v1.0 without showing the interactive license prompt.

  • device (torch.device | str | None) – The device.

Capabilities#

Supported Input Semantic Types

numerical

Supported Target Semantic Types

categorical, numerical

Supported Prediction Tasks

classification, regression

Multi-Target Support

❌

Related Table Support

❌

Default Recipe#

Recipe(
  features=Sequential(
    StypeDispatch(
      categorical=Sequential(
        AlignCategories(min_frequency=2),
        ToNumerical(),
      ),
    ),
    StypeDispatch(
      numerical=Sequential(
        ImputeMean(),
        DropConstantColumns(),
        Standardize(eps=1e-06),
        Clip(-100.0, 100.0),
        Choice(
          Identity(),
          PowerTransform(),
          method='round_robin',
        ),
        ClipSigma(threshold=4.0),
        ShuffleColumns(method='random'),
        SelectColumns(),
      ),
    ),
  ),
  target=StypeDispatch(
    numerical=Standardize(eps=0.0),
    categorical=Sequential(
      AlignCategories(sort_by='value'),
      ShuffleCategories(method='shift'),
    ),
  ),
  output=Sequential(
    AverageEstimators(),
    TaskDispatch(
      classification=Softmax(temperature=0.9),
    ),
  ),
)