TECHNOLOGY

TabPFN feature schema: categorical declarations, numeric codes and text are different inputs

In this article
THE QUICK TAKE

A categorical suggestion, a pandas categorical dtype and an undeclared string field can follow different preparation decisions.

Define the semantic schema before fitting

A table’s array shape does not identify whether a field is a quantity, category or free-form text. The TabPFN guide recommends using the library’s intended preparation rather than automatically applying generic one-hot encoding or scaling. Preserve feature names, order, dtypes and declared meaning. A code such as an equipment-class identifier should not silently become a continuous measurement merely because it is stored as an integer.

Read categorical declarations as a concrete contract

The classifier implementation explains how categorical indices and pandas category dtype participate in schema inference. It also qualifies numeric categorical suggestions rather than promising a hard override for every numerical column. Indices refer to the data supplied to fit, so a column permutation between configuration and fitting can target the wrong field. Validate declarations against the final prepared table, not an earlier schema snapshot.

Keep diverse strings distinct from fixed categories

The inference configuration distinguishes numerical-versus-categorical decisions from string-category-versus-text decisions in current releases. Explicit categorical string declarations can preserve category treatment, while undeclared diverse strings can follow another path. Do not transfer one cardinality threshold’s meaning to a different decision. Pin generation and preparation settings because text-related capabilities and feature expansion can differ across released checkpoints and library versions.

Preserve the fitted transformation at prediction

A prediction table must carry the schema expected by its fitted estimator. Re-encoding categories independently can change identities even when the encoded integers have the same range. The TabPFN fit guide explains the context state. Check missing values and previously unseen categories through the supported transformation path rather than composing an external encoder whose mapping was never part of the evaluated workflow.

Test ambiguous columns explicitly

Use a numeric category code, a declared string category, a diverse string field and a reordered table as reviewed fixtures. Inspect the resolved feature schema and compare the intended reference predictions. The entity-group guide provides related identity reasoning. A reliable adapter preserves meaning through representation changes; fitting successfully on an all-numeric matrix does not prove that categories, quantities and text retained their intended roles or that the preparation matches a previously evaluated model configuration.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles