Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions IHDP/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
IHDP Benchmark Covariates — License and Provenance Notice

This directory contains `ihdp_covariates.csv`, a covariate-only extract
derived from the IHDP semi-synthetic benchmark data.

Upstream sources and their licenses
------------------------------------

1. NPCI R package (vdorie/npci)
https://github.com/vdorie/npci
License: GPL (>= 2)
Role: Generated the 1000 IHDP benchmark replications from the original
IHDP trial covariates, using the response-surface design of Hill (2011).

2. CEVAE repository (AMLab-Amsterdam/CEVAE)
https://github.com/AMLab-Amsterdam/CEVAE
License: No explicit license file in the repository (archived July 2020).
Role: Hosts the NPCI-generated replications as CSV files. The file
`ihdp_npci_1.csv` from this repository is fetched by `prep.py` at
extraction time. It is not redistributed in this repository.

3. Original IHDP trial data
The underlying real covariates come from the Infant Health and
Development Program (IHDP), a randomized controlled trial. The
covariates were made available for research use through the benchmark
publications listed below.

What this file contains
-----------------------

`ihdp_covariates.csv` contains only the 25 pre-treatment covariates and
binary treatment indicator (747 rows × 26 columns). All outcome columns
(`y_factual`, `y_cfactual`, `mu0`, `mu1`) have been removed — pgmpy's
`IHDPDataset` simulator regenerates outcomes from these fixed covariates.

The extraction script `prep.py` downloads `ihdp_npci_1.csv` from the
CEVAE repository at runtime and produces `ihdp_covariates.csv`. The
source file is not bundled here.

Usage terms
-----------

The NPCI simulation code is released under GPL (>= 2). The CEVAE
repository does not specify a license. The extracted covariates are
included here for research and educational use consistent with the
original benchmark's intended purpose.

Users should:

- Cite the original papers when using this dataset.
- Respect any terms that may apply to the upstream repositories.
- Note that this notice documents provenance and is not a substitute
for legal permission from the original data authors.

Recommended citations
---------------------

- Hill, J. L. (2011). Bayesian Nonparametric Modeling for Causal
Inference. Journal of Computational and Graphical Statistics, 20(1),
217-240.
- Louizos, C., Shalit, U., Mooij, J. M., Sontag, D., Zemel, R., &
Welling, M. (2017). Causal Effect Inference with Deep Latent-Variable
Models. NeurIPS.
- Johansson, F., Shalit, U., & Sontag, D. (2016). Learning
Representations for Counterfactual Inference. ICML.
61 changes: 61 additions & 0 deletions IHDP/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# IHDP Covariates

This directory contains the fixed covariates and treatment assignment used by
pgmpy's IHDP semi-synthetic dataset simulator (`pgmpy.datasets.IHDPDataset`).

## Files

- `ihdp_covariates.csv` — covariate-only extract (747 rows × 26 columns:
`treatment` + `x1` through `x25`).
- `prep.py` — script that downloads `ihdp_npci_1.csv` from the
[CEVAE repository](https://github.com/AMLab-Amsterdam/CEVAE/tree/master/datasets/IHDP/csv),
extracts the covariates, validates the expected shape/counts/coding,
and writes `ihdp_covariates.csv`.
- `LICENSE` — provenance and licensing notice.

## Provenance

The extract is prepared from `ihdp_npci_1.csv` in the archived CEVAE
repository. The source file is **fetched at extraction time** by `prep.py`
(not bundled in this repo) to avoid redistributing upstream data.

The response-surface design follows the IHDP benchmark introduced by
Hill (2011) and the later CEVAE benchmark usage from Louizos et al. (2017).
The covariates and treatment assignment are fixed across the 1000
CEVAE/NPCI replications; only the simulated outcome columns vary.
Therefore pgmpy stores only the covariates and treatment needed to
generate outcomes inside `IHDPDataset`.

## Reproducing `ihdp_covariates.csv`

```bash
# Requires: numpy, pandas
python prep.py
```

The script downloads the source CSV, extracts covariates, runs validation
assertions, and writes `ihdp_covariates.csv`. The output is byte-identical
across runs given the same upstream file.

## Column details

- `x1`–`x6` (continuous): birth weight, head circumference, weeks preterm,
birth order, neonatal health index, mother's age. Already standardized
(mean ≈ 0, std ≈ 1) in the upstream CEVAE/NPCI file.
- `x7`–`x25` (binary/categorical): site and demographic indicators. All
are `{0, 1}` except `x14` ("first" — firstborn), which is `{1, 2}` by
upstream convention (matches EconML's coding).

## References

- Hill, J. L. (2011). Bayesian Nonparametric Modeling for Causal Inference.
*Journal of Computational and Graphical Statistics*, 20(1), 217–240.
- Louizos, C., Shalit, U., Mooij, J. M., Sontag, D., Zemel, R., &
Welling, M. (2017). Causal Effect Inference with Deep Latent-Variable
Models. *NeurIPS*.
- Johansson, F., Shalit, U., & Sontag, D. (2016). Learning Representations
for Counterfactual Inference. *ICML*.

## License

See [LICENSE](LICENSE) in this directory.
Loading