From a85ae29df70627ef3b79f0c490030e064f91895d Mon Sep 17 00:00:00 2001 From: PoorvaGarg Date: Tue, 27 Aug 2024 13:30:20 -0400 Subject: [PATCH] changes for correct rendering --- docs/source/explainable_categorical.ipynb | 189 ++++++++++++---------- 1 file changed, 107 insertions(+), 82 deletions(-) diff --git a/docs/source/explainable_categorical.ipynb b/docs/source/explainable_categorical.ipynb index 02e2423c2..2c949678f 100644 --- a/docs/source/explainable_categorical.ipynb +++ b/docs/source/explainable_categorical.ipynb @@ -24,26 +24,21 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Outline**\n", - "\n", - "[Motivation](#motivation)\n", - "\n", - "[Setup](#setup)\n", - "\n", - "[But-for Causal Explanations](#but-for-causal-explanations) \n", - "\n", - "[Context-sensitive Causal Explanations](#context-sensitive-causal-explanations)\n", - "\n", - "[Probability of causation and responsibility](#probability-of-causation-and-responsibility)\n", - "\n", - "[Further Discussion](#further-discussion)" + "## Outline\n", + "\n", + "- [Motivation](#motivation)\n", + "- [Setup](#setup)\n", + "- [But-for Causal Explanations](#but-for-causal-explanations) \n", + "- [Context-sensitive Causal Explanations](#context-sensitive-causal-explanations)\n", + "- [Probability of causation and responsibility](#probability-of-causation-and-responsibility)\n", + "- [Further Discussion](#further-discussion)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "# Motivation\n", + "## Motivation\n", "\n", "Consider the following causality-related queries:\n", "\n", @@ -67,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -106,7 +101,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -165,7 +160,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -177,54 +172,84 @@ "\n", "\n", - "\n", - "\n", - "\n", + "\n", + "\n", + "\n", "\n", "\n", "u_match_dropped\n", - "\n", - "u_match_dropped\n", + "\n", + "u_match_dropped\n", "\n", "\n", "\n", "match_dropped\n", - "\n", - "match_dropped\n", + "\n", + "match_dropped\n", + "\n", + "\n", + "\n", + "u_match_dropped->match_dropped\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "forest_fire\n", + "\n", + "forest_fire\n", + "\n", + "\n", + "\n", + "u_match_dropped->forest_fire\n", + "\n", + "\n", "\n", "\n", "\n", "u_lightning\n", - "\n", - "u_lightning\n", + "\n", + "u_lightning\n", "\n", "\n", "\n", "lightning\n", - "\n", - "lightning\n", + "\n", + "lightning\n", + "\n", + "\n", + "\n", + "u_lightning->lightning\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "u_lightning->forest_fire\n", + "\n", + "\n", "\n", "\n", "\n", "smile\n", - "\n", - "smile\n", + "\n", + "smile\n", "\n", - "\n", - "\n", - "forest_fire\n", - "\n", - "forest_fire\n", + "\n", + "\n", + "smile->forest_fire\n", + "\n", + "\n", "\n", "\n", "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 23, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -295,14 +320,14 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2987)\n" + "tensor(0.2973)\n" ] } ], @@ -329,14 +354,14 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.6000)\n" + "tensor(0.5895)\n" ] } ], @@ -363,7 +388,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -397,7 +422,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -422,14 +447,14 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(2.8055e-06)\n" + "tensor(2.7697e-06)\n" ] } ], @@ -453,14 +478,14 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(2.7924e-06)\n" + "tensor(2.7853e-06)\n" ] } ], @@ -478,14 +503,14 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.0670)\n" + "tensor(0.0661)\n" ] } ], @@ -516,14 +541,14 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2772)\n" + "tensor(0.2690)\n" ] } ], @@ -550,7 +575,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -595,7 +620,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -660,7 +685,7 @@ "sally_hits\n", "\n", "\n", - "\n", + "\n", "prob_sally_hits->sally_hits\n", "\n", "\n", @@ -696,7 +721,7 @@ "bottle_shatters\n", "\n", "\n", - "\n", + "\n", "prob_bottle_shatters_if_sally->bottle_shatters\n", "\n", "\n", @@ -708,31 +733,31 @@ "prob_bottle_shatters_if_bill\n", "\n", "\n", - "\n", + "\n", "prob_bottle_shatters_if_bill->bottle_shatters\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "sally_throws->sally_hits\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "bill_throws->bill_hits\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "sally_hits->bill_hits\n", "\n", "\n", "\n", "\n", - "\n", + "\n", "sally_hits->bottle_shatters\n", "\n", "\n", @@ -747,10 +772,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 33, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -828,7 +853,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -864,7 +889,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -899,14 +924,14 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2513)\n" + "tensor(0.2514)\n" ] } ], @@ -935,14 +960,14 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.5019)\n" + "tensor(0.5031)\n" ] } ], @@ -962,7 +987,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -998,7 +1023,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -1027,14 +1052,14 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.1543)\n" + "tensor(0.1537)\n" ] } ], @@ -1078,14 +1103,14 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2195)\n" + "tensor(0.2126)\n" ] } ], @@ -1103,14 +1128,14 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.0667)\n" + "tensor(0.0662)\n" ] } ], @@ -1128,14 +1153,14 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2777)\n" + "tensor(0.2745)\n" ] } ], @@ -1146,14 +1171,14 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 24, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "tensor(0.2014)\n" + "tensor(0.2013)\n" ] } ], @@ -1173,7 +1198,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Further Discussion\n", + "## Further Discussion\n", "\n", "In this notebook, we have shown how `SearchForExplanation` can be used for fine-grained causal queries for discrete causal models. We further elaborate on its application in for different queries. \n", "\n",