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:
ICLModelThe tabular foundation model from “Introducing TabFM: A Zero-shot Foundation Model for Tabular Data”.
Architecturally,
TabFMcan be viewed as a scaled-upTabICLv2-style model with Fourier cell embeddings, separate numerical and categorical cell projections, two repeated column/row interaction stages,RMSNorm-based transformer blocks andSwiGLUfeed-forward blocks.Note
TabFMmodel 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 viaaccept_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 |
|
Supported Target Semantic Types |
|
Supported Prediction Tasks |
|
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),
),
),
)