Notebook’s tools for causality
Visualization helpers for causal models in Jupyter notebooks. These functions render
pyagrum.CausalModel instances and causal inference results as graphical outputs.
- pyagrum.lib.notebook.getCausalModel(cm, size=None)
return a HTML representing the causal model
- Parameters:
cm (
CausalModel) – the causal modelsize (
float|str|None) – the size of the rendered graph
- Returns:
the dot representation
- Return type:
str
- pyagrum.lib.notebook.showCausalModel(cm, size=None)
Shows a pydot svg representation of the causal DAG
- Parameters:
cm (
CausalModel) – the causal modelsize (
float|str|None) – the size of the rendered graph
- Return type:
None
- pyagrum.lib.notebook.getCausalImpact(model, on, doing, knowing=None, values=None)
return a HTML representing of the three values defining a causal impact : formula, value, explanation
- Parameters:
model (
CausalModel) – the causal modelon (
str|set[str]) – the impacted variable(s)doing (
str|set[str]) – the interventionsknowing (
set[str] |None) – the observationsvalues (
dict[str,int] |None) – value for certain variables
- Return type:
HTML
- pyagrum.lib.notebook.showCausalImpact(model, on, doing, knowing=None, values=None)
display a HTML representing of the three values defining a causal impact : formula, value, explanation
- Parameters:
model (
CausalModel) – the causal modelon (
str|set[str]) – the impacted variable(s)doing (
str|set[str]) – the interventionsknowing (
set[str] |None) – the observationsvalues (
dict[str,int] |None) – value for certain variables
- Return type:
None