Skip to content

About

FTFM-1: a factorized tabular foundation model (inference)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

FTFM — Factorized Tabular Foundation Model

Inference code for FTFM-1. Cell representations are built by factorizing one contextual latent per row against one per column, rather than by cell-to-cell attention. The support-side computation is cached once at fit and reused across test queries without approximation.

Install

pip install "git+https://github.com/machinelearningnuremberg/ftfm-official.git"

Python ≥ 3.10 and PyTorch ≥ 2.4. Pin a release with @<tag-or-commit> after .git. Over SSH: pip install "git+ssh://git@github.com/machinelearningnuremberg/ftfm-official.git".

Weights

The weights (FTFM-1, stage C at update 130,000, 464 MiB fp32) live on the Hugging Face Hub at josifgrabocka/ftfm and are downloaded on the first fit, then served from ~/.cache/huggingface. To fetch them ahead of time, e.g. before an offline job:

ftfm-download                          # into the Hugging Face cache
ftfm-download --local-dir ./ftfm-weights

or from Python:

from ftfm import download_checkpoint
path = download_checkpoint()           # directory with model.safetensors + config.json

A directory written with --local-dir is read back with FTFMClassifier(model_path="./ftfm-weights"); allow_auto_download=False forbids any network access.

Usage

from ftfm import FTFMClassifier

clf = FTFMClassifier().fit(X_train, y_train)
proba = clf.predict_proba(X_test)

scikit-learn API; DataFrames with string columns are accepted, and cat_features= overrides categorical detection. The default predicts with an 8-member view ensemble; n_estimators=1 gives a single forward pass, and FTFMSingleClassifier the un-ensembled wrapper.

Regression

FTFMRegressor is not yet implemented; constructing one raises NotImplementedError.

Layout

ftfm/model.py      the architecture
ftfm/serving.py    cached support-side inference
ftfm/estimator.py  scikit-learn estimators, ingest, weight loading
ftfm/ensemble.py   view ensembling
ftfm/hub.py        checkpoint download

Licence

Code is Apache-2.0 (LICENSE). The model weights are CC BY-NC 4.0, non-commercial (LICENSE-WEIGHTS.md); they are not in this repository and are downloaded from the Hub under those terms.

About

FTFM-1: a factorized tabular foundation model (inference)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages