Installation
get_tags
View source ClientTabPFNClassifier
View source ClientTabPFNClassifier.get_params
View source ClientTabPFNRegressor
View source ClientTabPFNRegressor.get_params
View source FakeTorchDevice
View source TabPFNEstimator
View source TabPFNEstimator.fit
View source TabPFNEstimator.predict
View source get_max_num_classes
View source get_inference_config().MAX_NUMBER_OF_CLASSES), which TabPFN exposes as
of v8.0.0 (the minimum version this package depends on).
get_tabpfn_models
View source USE_TABPFN_LOCAL selects the backend; the function does not silently fall
back to the other one:
USE_TABPFN_LOCALisTrue-> the standardtabpfnpackageUSE_TABPFN_LOCALisFalse-> thetabpfn-clientAPI backend
ImportError
If the selected TabPFN backend is not installed
infer_categorical_features
View source get_max_num_classes and apply it at the point of use.
A column is treated as categorical if any of these hold:
- It is in the caller-provided
categorical_featureslist. - It has a string/object/category dtype (pandas DataFrame).
- It contains string values (numpy object array).
- It is low-cardinality: at most
MAX_UNIQUE_VALUES_FOR_CATEGORICALunique values, with more thanMIN_SAMPLES_PER_CATEGORYsamples per unique value on average, to avoid mislabelling columns that only look low-cardinality because the sample is too thin per level.
infer_device
View source Type aliases
Type aliases
infer_torch_device
View source tabpfn.
With tabpfn installed this is TabPFN’s own reading of device. Without it,
the same rule on torch directly: for "auto", CUDA, else MPS, else the CPU,
minus what TABPFN_EXCLUDE_DEVICES names; anything else is parsed as a torch
device, the first of several.
is_tabpfn
View source product_dict
View source softmax
View source warn_if_no_kv_cache
View source use_kv_cache=True,
which is the only condition. A local model needs both:
modelwas constructed withfit_mode="fit_with_cache"(a constructor argument, must be set BEFORE.fit()).model.executor_.keep_cache_on_deviceisTrue(set AFTER.fit(); usually the default but worth setting explicitly).