https://github.com/werkaaa/iscm
Standardizing Structural Causal Models, ICLR 2025
https://github.com/werkaaa/iscm
benchmarking causal-discovery causality scm structure-learning
Last synced: 3 months ago
JSON representation
Standardizing Structural Causal Models, ICLR 2025
- Host: GitHub
- URL: https://github.com/werkaaa/iscm
- Owner: werkaaa
- License: mit
- Created: 2025-02-26T23:41:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-19T11:42:54.000Z (12 months ago)
- Last Synced: 2025-09-28T07:02:14.219Z (8 months ago)
- Topics: benchmarking, causal-discovery, causality, scm, structure-learning
- Language: Jupyter Notebook
- Homepage: https://arxiv.org/abs/2406.11601
- Size: 583 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Standardizing Structural Causal Models
 [](https://doi.org/10.5281/zenodo.15697868)
This is the code repository for the paper *Standardizing Structural Causal Models*
([Ormaniec et al., 2025](https://openreview.net/forum?id=aXuWowhIYt&referrer=%5BAuthor%20Console%5D), ICLR 2025).
Comprehensive code for reproducing the results from the paper can be found in the
[iscm_full](https://github.com/werkaaa/iscm/tree/iscm_full) branch. Here, we introduce the `iscm` library that packages
sampling from iSCMs, SCMs, and naively standardized SCMs.
## Library
To install the `iscm` library, run:
```
pip install iscm
```
The code snippet below shows how you can sample from an iSCM.
```python
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](https://github.com/werkaaa/iscm/blob/main/iscm/graph_sampler.py) and [data_sampler.py](https://github.com/werkaaa/iscm/blob/main/iscm/data_sampler.py) to sample graphs and data.
For an overview of library functionalities, see [iSCM_Tutorial.ipynb](https://github.com/werkaaa/iscm/blob/main/iSCM_Tutorial.ipynb), which you can directly open in Google Colab:
## Reference
```
@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}
}
```