Y0 is a Python library for graph-based causal identification. It represents probability, intervention, and counterfactual queries so algorithms can determine whether observational or experimental data support a causal conclusion. section 10.0 section 10.1.1
Y0 supports a causal workflow by:
- Representing queries with domain-specific Python objects such as Probability and Variable. section 10.1.1
- Applying graph algorithms to assess identification and derive estimands from causal models. section 10.0
- Producing parallel-world and query-specific counterfactual graphs from directed acyclic graphs. section 11.6.1
Online gaming query
Define engagement and in-game purchases as Y0 variables, then construct a probability query such as P(I) or P(I | E) using the library’s DSL. The same causal hierarchy distinguishes intervention queries from counterfactual questions about what a player’s purchases would have been under different engagement. section 10.1.1 section 10.0
Listing 10.1 Creating a query in y0
!pip install git+https://github.com/y0-causal-inference/y0.git@v0.2.0
from y0.dsl import P, Variable #1
E = Variable("E") #2
I = Variable("I") #2
query = P[E](I) #3
query #4
Inspect the minimal Python construction of a Y0 query, including installation, variable declaration, probability notation, and rendered output. section 10.1.1
