cascade.graph.core_explanation_graph

cascade.graph.core_explanation_graph(annotated, leaves, min_frac_ptr=0.05, depth_limit=None)[source]

Extract the core explanation graph from an annotated causal graph that explains the predicted change in a list of leaf nodes

Parameters:
  • annotated (DiGraph) – Annotated causal graph (from annotate_explanation())

  • leaves (list[str]) – List of leaf nodes

  • min_frac_ptr (float) – Minimal explained fraction for an edge to be considered

  • depth_limit (int | None) – Depth limit for the breadth-first search

Return type:

DiGraph

Returns:

Core explanation graph