axiom-effect / README.md
maxpagels's picture
Release 1.1.0
a1a7e85 verified
|
Raw History Blame Contribute Delete
5.52 kB
---
library_name: axiom-effect
tags:
- causal-inference
- effect-estimation
- data-fusion
- foundation-model
- tabular
- pytorch
license: apache-2.0
---
# Axiom Effect
A zero-shot foundation model for tabular causal effect estimation: what happens to an outcome when
a treatment is *set* to one value instead of another. For binary treatments it estimates the
average treatment effect (ATE), the effect on the treated (ATT) and on the controls (ATC), and
every row's individual effect (CATE). For continuous treatments it estimates pairwise contrasts,
full nonlinear dose-response curves, and per-row effects — each with calibrated 90% and 50%
uncertainty intervals. Trained on synthetic causal mechanisms over synthetic and public tabular
covariates (with no evaluation benchmark data).
It works without a causal graph (assuming measured covariates are pre-treatment), with an exact
DAG or a discovered graph from [Axiom Discovery](https://huggingface.co/liminalplanes/axiom-discovery),
and with **observational + experimental data fusion**: passing a small randomized slice via
`interventions=` fuses both sources in a single forward pass to remove unmeasured confounding while
borrowing statistical strength from the observational table.
21.8M parameters, fp32 safetensors (87 MB). Project page:
[liminalplanes.com/axiom-effect](https://www.liminalplanes.com/axiom-effect).
## Benchmarks
Full benchmark results, speed vs. accuracy plots, and observational + experimental data fusion
comparisons (IHDP-100, ACIC 2016, LaLonde NSW + PSID/CPS, ACTG 175, Project STAR, and Criteo
Uplift) are published at [liminalplanes.com/axiom-effect](https://www.liminalplanes.com/axiom-effect).
For a deeper walkthrough of zero-shot causal data fusion, see the research note at
[liminalplanes.com/note/zero-shot-data-fusion](https://www.liminalplanes.com/note/zero-shot-data-fusion).
## Recommended use (ballpark)
| | recommendation |
|---|---|
| treatment | binary (two values) or continuous (at least 10 distinct values); continuous values inside its 2-98% quantiles |
| covariates | trained on up to 84; without a graph they must all be pre-treatment (not caused by the treatment) |
| graph | none; a DAG you trust (the treatment's descendants are then dropped); or an Axiom `discover()` result |
| data fusion | pass `interventions=` (1D bool mask for randomized treatment rows, 2D mask, or per-row column list) to fuse observational and experimental data |
| rows | trained on 128-1536; larger tables are split into disjoint subsets of up to 1536 rows and combined |
| hidden confounders | handled when randomized rows are supplied via `interventions=`; without `interventions=`, assumes no unmeasured confounding |
| missing values | not supported in the columns used |
## Usage
```bash
pip install "git+https://huggingface.co/liminalplanes/axiom-effect"
```
```python
from axiom_effect import AxiomEffect
model = AxiomEffect.from_pretrained("liminalplanes/axiom-effect")
r = model.effect(df, treatment="discount", outcome="spend") # observational, no graph
print(r)
r.ate, r.att # (estimate, lo, hi), 90%
r.cate # every row's effect
```
With observational + experimental data fusion:
```python
# df["is_rct"] is True for rows from a randomised experiment / A/B test, False for observational logs
r = model.effect(df, treatment="therapy", outcome="cd4_20w", interventions=df["is_rct"])
r.ate # unified Empirical-Bayes fused estimate (estimate, lo_90, hi_90)
```
With a causal graph:
```python
graph = [("age", "discount"), ("age", "spend"), ("discount", "visits"), ("visits", "spend")]
r = model.effect(df, "discount", "spend", graph=graph) # visits (a mediator) is not adjusted for
from axiom import Axiom
g = Axiom.from_pretrained("liminalplanes/axiom-discovery").discover(df)
r = model.effect(df, "discount", "spend", graph=g) # role probabilities from the discovered graph
r.roles # what the model was told about each covariate
```
A graph can be a list of (cause, effect) column names, a (d, d) adjacency matrix in the
table's column order, an adjacency DataFrame, or a `discover()` result. Continuous
treatments take `contrast=(a, b)` (default: the 25% and 75% quantiles), `values`
for the curve (default: the 10/25/50/75/90% quantiles) and `reference` (default: the median).
Everything is in the data's own units.
## Limitations
- Without `interventions=`, identification is by covariate adjustment only (no unmeasured
confounders). When `interventions=` is provided, hidden confounding is removed assuming the
flagged rows are genuinely randomized.
- A DAG is taken as true; a discovered graph is read as probabilities, but it can still be
wrong in ways the probabilities do not show.
- Large, wide tables are split into row subsets (see above), and accuracy is stronger within
the training range than on much larger tables.
- Neural uncertainty intervals are empirical quantiles calibrated on the training prior; under
severe out-of-distribution shift, intervals may be conservative or slightly miscalibrated.
## Versions
Each release is a tagged commit in this repo; `main` is the latest. The package loads the
weights released with it, so code and weights always match. To install a specific release,
an earlier one included, use its tag:
```bash
pip install "git+https://huggingface.co/liminalplanes/axiom-effect@v1.1.0" # or an earlier tag, e.g. @v1.0.0
```