This is the code repository for the paper Standardizing Structural Causal Models (Ormaniec et al., 2025, ICLR 2025).
Comprehensive code for reproducing the results from the paper can be found in the
iscm_full branch. Here, we introduce the iscm library that packages
sampling from iSCMs, SCMs, and naively standardized SCMs.
To install the iscm library, run:
pip install iscm
The code snippet below shows how you can sample from an iSCM.
import numpy as np
from iscm import data_sampler, graph_sampler
rng = np.random.default_rng(seed=0)
# Generate a graph
graph = graph_sampler.generate_erdos_renyi_graph(
num_nodes=20,
edges_per_node=2,
weight_range=(0.5, 2.0), # The weights will be sampled randomly from ± weight range
rng=rng,
)
# Sample data
iscm_sample = data_sampler.sample_linear(
graph=graph,
sample_size=100,
standardization='internal',
rng=rng,
)We recommend using the functions in graph_sampler.py and data_sampler.py to sample graphs and data. For an overview of library functionalities, see iSCM_Tutorial.ipynb, which you can directly open in Google Colab:
@article{ormaniec2025standardizing,
title={Standardizing Structural Causal Models},
author={Weronika Ormaniec and Scott Sussex and Lars Lorch and Bernhard Sch{\"o}lkopf and Andreas Krause},
journal={The Thirteenth International Conference on Learning Representations},
year={2025}
}