
Getting Started
Install theunsupervised extension:
TabPFNUnsupervisedModel with a TabPFN classifier and regressor model to generate new data:
How it Works
The data generation process leverages the same probabilistic modeling used in TabPFN’s unsupervised mode:- Each feature is modeled conditionally on the others.
- The chain rule of probability is used to estimate the full joint distribution.
- New samples are drawn using the learned conditional dependencies, controlled by a temperature parameter (
temp) that influences variability and diversity.
Causally-Informed Generation with a DAG
By default, each feature is conditioned on all other features. If you have prior knowledge about the causal structure of your data, you can pass a Directed Acyclic Graph (DAG) togenerate_synthetic_data via the dag parameter. This restricts each feature’s conditioning set to its declared parents, so generated samples respect your domain knowledge about feature dependencies.
The dag is a dict[int, list[int]] mapping each feature index to the list of its parent feature indices. Every feature must appear as a key — including features with no parents, which you declare with an empty parent list ([]) so they are generated marginally. Passing an incomplete DAG raises a ValueError. Features are generated in topological order (parents before children), starting with the parentless ones.
The DAG must be acyclic. A
ValueError is raised if a cycle is detected, with the cycle path included in the error message. Features listed with an empty parent list ([]) are generated first using only marginal information.Use Cases
Synthetic data generation can be applied across a range of research and engineering tasks:- Data augmentation - expand limited datasets for training or validation.
- Privacy-preserving analytics - create realistic datasets without exposing sensitive information.
- Counterfactual generation - synthesize data under interventions by modifying the DAG.
Google Colab Example
Check out our Google Colab for a demo.