Skip to contents

Tabular foundation model developed by Google Research. Uses reticulate to interface with the tabfm Python package. The model makes zero-shot predictions via in-context learning and is not trained on the data in the usual sense. Features are passed to tabfm as a data frame, so that categorical features are ordinal encoded and missing values are imputed by the package's own preprocessing pipeline.

Installation

This learner relies on reticulate to handle Python dependencies. It is not necessary to install any Python package manually in advance or specify a Python environment via reticulate::use_python(), reticulate::use_virtualenv(), reticulate::use_condaenv(), or reticulate::use_miniconda(). By calling $train() or $predict(), the required Python packages will be installed automatically, if not already. The backend parameter selects which extra is installed: "jax" installs tabfm[jax] and "pytorch" installs tabfm[pytorch]. Reticulate will then configure and initialize an ephemeral environment satisfying those requirements, unless an existing environment (e.g., "r-reticulate") in reticulate's Order of Discovery contains all the necessary packages.

You may also manually install tabfm into a Python environment following the official installation guide and specify the environment via reticulate::use_*() before calling $train() or $predict().

On the first call to $train(), the pre-trained model weights (about 100 MB) are downloaded from Hugging Face and cached for subsequent calls.

Saving a Learner

In order to save a LearnerRegrTabFM for later usage, it is necessary to call the $marshal() method on the Learner before writing it to disk, as the object will otherwise not be saved correctly. After loading a marshaled LearnerRegrTabFM into R again, you then need to call $unmarshal() to transform it into a useable state. The several gigabyte pre-trained backbone is not serialized; it is detached before marshaling and reloaded from the Hugging Face cache on $unmarshal().

Custom mlr3 parameters

  • backend selects the computational backend, either "jax" or "pytorch". It also determines which pre-trained weights are downloaded and which Python packages are installed.

  • device is only used by the "pytorch" backend and is passed as a string to the model loader, e.g., "cpu" or "cuda". The "jax" backend ignores this parameter and selects the device automatically.

  • norm_methods accepts a single string or a character vector with values from "none", "power", "quantile", "quantile_rtdl", and "robust".

  • n_feature_crosses and n_svd_features accept either a non-negative integer or the string "sqrt".

  • cache_context is only supported by the "pytorch" backend.

  • random_state accepts either an integer or the special value "None" which corresponds to None in Python.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.tabfm")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”

  • Required Packages: mlr3, reticulate

Parameters

IdTypeDefaultLevelsRange
backendcharacter-jax, pytorch-
deviceuntyped--
n_estimatorsinteger32\([1, \infty)\)
norm_methodsuntyped--
feat_shuffle_methodcharacterrandomrandom, none-
permute_categoricallogicalFALSETRUE, FALSE-
outlier_thresholdnumeric4\((-\infty, \infty)\)
max_num_featuresinteger500\([1, \infty)\)
max_num_rowsinteger-\([1, \infty)\)
use_amplogicalTRUETRUE, FALSE-
batch_sizeinteger1\([1, \infty)\)
random_stateinteger42\((-\infty, \infty)\)
verboselogicalFALSETRUE, FALSE-
cat_encoder_modecharacterappearanceappearance, frequency-
num_folds_for_cvinteger5\([2, \infty)\)
n_feature_crossesuntyped0L-
n_svd_featuresuntyped0L-
total_svd_poolinteger-\([1, \infty)\)
enable_nnlslogicalFALSETRUE, FALSE-
nnls_betanumeric0.75\((-\infty, \infty)\)
min_rows_for_single_val_splitinteger2000\([0, \infty)\)
cache_contextlogicalFALSETRUE, FALSE-
maybe_quantize_kv_cachelogicalTRUETRUE, FALSE-
keep_cache_on_devicelogicalTRUETRUE, FALSE-

References

Google Research (2026). “TabFM: Tabular Foundation Models.” https://github.com/google-research/tabfm.

See also

Author

be-marc

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrTabFM

Active bindings

marshaled

(logical(1))
Whether the learner has been marshaled.

Methods

Inherited methods


LearnerRegrTabFM$new()

Creates a new instance of this R6 class.

Usage


LearnerRegrTabFM$marshal()

Marshal the learner's model.

Usage

LearnerRegrTabFM$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


LearnerRegrTabFM$unmarshal()

Unmarshal the learner's model.

Usage

LearnerRegrTabFM$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::unmarshal_model().


LearnerRegrTabFM$clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrTabFM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.