Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of CausalModel from notebooks and test files #1220

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions docs/source/example_notebooks/do_sampler_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,21 @@
"metadata": {},
"outputs": [],
"source": [
"from dowhy import CausalModel\n",
"from dowhy.causal_graph import CausalGraph\n",
"\n",
"\n",
"causes = ['D']\n",
"outcomes = ['Y']\n",
"common_causes = ['Z']\n",
"\n",
"model = CausalModel(df, \n",
" causes,\n",
" outcomes,\n",
" common_causes=common_causes)\n",
"nx_graph = model._graph._graph"
"graph = CausalGraph(\n",
" causes,\n",
" outcomes,\n",
" common_cause_names=common_causes,\n",
" observed_node_names=df.columns.tolist(),\n",
")\n",
"\n",
"nx_graph = graph._graph"
]
},
{
Expand All @@ -145,7 +149,9 @@
"metadata": {},
"outputs": [],
"source": [
"identification = model.identify_effect(proceed_when_unidentifiable=True)"
"from dowhy.causal_identifier import identify_effect\n",
"\n",
"identification = identify_effect(nx_graph, action_nodes=causes, outcome_nodes=outcomes, observed_nodes=list(graph.get_all_nodes(include_unobserved=False)))"
]
},
{
Expand Down Expand Up @@ -225,7 +231,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.11.8"
},
"toc": {
"base_numbering": 1,
Expand Down
426 changes: 404 additions & 22 deletions docs/source/example_notebooks/dowhy_confounder_example.ipynb

Large diffs are not rendered by default.

686 changes: 654 additions & 32 deletions docs/source/example_notebooks/dowhy_interpreter.ipynb

Large diffs are not rendered by default.

Loading