Notebook’s tools for causality

This file defines some helpers for handling causal concepts in notebooks

pyAgrum.causal.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 model

  • on (str | Set[str]) – the impacted variable(s)

  • doing (str | Set[str]) – the interventions

  • knowing (str | Set[str]) – the observations

  • values (Dict[str,int] default=None) – value for certain variables

Return type:

HTML

pyAgrum.causal.notebook.getCausalModel(cm, size=None)

return a HTML representing the causal model

Parameters:
  • cm (CausalModel) – the causal model

  • size (int|str) – the size of the rendered graph

Returns:

the dot representation

Return type:

pydot.Dot

pyAgrum.causal.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 model

  • on (str | Set[str]) – the impacted variable(s)

  • doing (str | Set[str]) – the interventions

  • knowing (str | Set[str]) – the observations

  • values (Dict[str,int] default=None) – value for certain variables

pyAgrum.causal.notebook.showCausalModel(cm, size=None)

Shows a pydot svg representation of the causal DAG

Parameters:
  • cm (CausalModel) – the causal model

  • size (int|str) – the size of the rendered graph