Tutorials
Welcome to the CausalFM Toolkit tutorials! These step-by-step guides will help you get started with causal inference using foundation models.
Tutorial Series
Tutorial Overview
Tutorial 1: Basics
Learn the fundamentals of CausalFM:
Understanding the foundation model approach
Key concepts: PFNs, in-context learning, CATE estimation
Basic workflow from data to predictions
Tutorial 2: Data Generation
Master data generation for different settings:
Standard CATE data generation
Instrumental variables data
Front-door adjustment data
Understanding DAG-structured SCMs
Tutorial 3: Training Models
Learn how to train your own models:
Configuring training runs
Monitoring training progress
Saving and loading checkpoints
Training for different causal settings
Tutorial 4: Model Evaluation
Evaluate your models effectively:
Computing causal inference metrics
Uncertainty quantification
Visualization techniques
Comparing multiple models
Prerequisites
Before starting these tutorials, make sure you have:
✅ Installed CausalFM Toolkit (see Installation)
✅ Basic Python knowledge
✅ Familiarity with PyTorch (helpful but not required)
✅ Understanding of causal inference concepts (helpful but not required)
What You’ll Learn
By completing these tutorials, you will be able to:
Generate synthetic causal datasets
Train foundation models for causal inference
Make predictions with pretrained models
Evaluate model performance
Apply CausalFM to your own causal inference problems
Example Notebooks
For hands-on examples, check out the Jupyter notebooks in the evaluation/notebook/ directory:
test_standard_cate.ipynb- Standard CATE estimationtest_iv_binary.ipynb- Binary instrumental variablestest_iv_conti.ipynb- Continuous instrumental variablestest_fd.ipynb- Front-door adjustmenttest_jobs.ipynb- Real-world dataset example
These notebooks provide complete working examples you can run and modify.
Getting Help
If you get stuck:
Check the ../user_guide/index for detailed explanations
Look at the Standard CATE Estimation Example for complete code
Read the API Reference for API documentation
Open an issue on GitHub if you find a bug
Let’s Get Started!
Ready to begin? Start with Tutorial 1: Basics to learn the fundamentals!