{"componentChunkName":"component---node-modules-gatsby-theme-try-ghost-src-templates-post-js","path":"/shapley-additive-explanations-shap/","result":{"data":{"ghostPost":{"id":"Ghost__Post__63ff26ec72a3c427182edd36","title":"Shapley Additive Explanations (SHAP)","slug":"shapley-additive-explanations-shap","featured":false,"feature_image":"https://images.unsplash.com/photo-1522069213448-443a614da9b6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDR8fGdhbWUlMjB0aGVvcnl8ZW58MHx8fHwxNjc3NjY2MTQ5&ixlib=rb-4.0.3&q=80&w=2000","excerpt":"Shapley Additive Explanations (SHAP) is a game-theoretic approach to interpret the output of any machine learning model. It aims to explain the contribution of each feature to the final prediction of the model, thereby providing a clear understanding of how the model makes its decisions. ","custom_excerpt":"Shapley Additive Explanations (SHAP) is a game-theoretic approach to interpret the output of any machine learning model. It aims to explain the contribution of each feature to the final prediction of the model, thereby providing a clear understanding of how the model makes its decisions. ","visibility":"public","created_at_pretty":"1 Mar 2023","published_at_pretty":"1 Mar 2023","updated_at_pretty":"14 Oct 2024","created_at":"2023-03-01T15:50:28.000+05:30","published_at":"2023-03-01T16:06:46.000+05:30","updated_at":"2024-10-14T22:57:53.000+05:30","meta_title":null,"meta_description":null,"og_description":null,"og_image":null,"og_title":null,"twitter_description":null,"twitter_image":null,"twitter_title":null,"authors":[{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":null}],"primary_author":{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":{"base":"Screenshot-from-2022-09-07-18-00-00.png","publicURL":"/static/28e31bfedd96b4afe90237d2c1f700c3/Screenshot-from-2022-09-07-18-00-00.png","imageMeta":{"width":316,"height":237},"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEJElEQVQ4yyXO21fTBQDA8d9fUh5LQAW1eEImbIPJbSB3kZtijjSBxNvAGSAqlJZ64GAHIQ0VjkKICCiCQ8cYsYFjYwhsYxeGjJsopmEnH76dYw+f94/w2jmKfaSX9wtTrC1a+bBk5d83dlbnzFhHehnq62TBZeLjGyfvFqf4a9nGstuAx/oM96Qai76NieFu5u0jLLrNCCsOI47nat56J1hbtLH60kTfg5tUV6hQFeSSFLGTgtwcBtUteGc0zLoGmXNpmXU8Yd6txTOlxvq8hzmr/hNhyTaC06hmya3nn6VxHKMPKS08RFF+HgWK/aiO5JP3TQ4xMgn3mqt599bC8pyBRY+OxRkdXkc/rrE+POZ+nMY+hFXHKPPWP5m3a/i4Yqax9kfCREEkyKPJSk3mQFYmOelpRISGEBMuwahv4/WC4dNuwa3l1Us906O9jGs7sWg7EHQdv6NurWVmvJv33iHKTuSyft06tm3xJygwEIlIxDb/zUhFIvw2+HDrxkX+XjUx5x7A6+pn3qXBZnyIoacFTftNhKarlTxprsMz3sPbWR2jmiYiJSICt27lqwB/tmza+L8Af5KkYsYNHXhcvbidahy2x0ya2jFqm7lxqYxrF04jvLQMYB16jKazHrOulRWHjiJFOus/+5yAjX5s8vNhs58vfj5foooO43LJMaovncI1/ZhpWxcTlk6mRjrpa7uOrqsJYcaiY25imKftv6F52IBx4D61Z46y6Yv1+PpsYLOvD36+G0gJDuRcrIS0nTvY8XUAl66osDq60A3e5sHtXzCoW3CY+hHeeKdZdL5gytDDgsOAe1zL9KiawowEsoK2URi+HWWMmKvZuzibKuNcqoTiWBEXShToLHfo7K6h+9413DYzS/MehJnJYZxjOowDHdjHnjE53M2kUU1/zVmu742lOlNOkyKRmtzd1KkUtObFcacgmUetVTT0/kTDvQpemPoxDWmoralG8NrNvJqZwmbS8Xp5FrfNhMtuxtNei75Kia3xAmtdVZgaf6axvprKvXH8kB5FXd1lFMcyuVp7Hnd9E0+bb5Cdvgfhw4oXPq5hGR5kzGzkUVcPVeWlPK8tx/BrCfcrjnI+bx+KPSmcPJxP2QklFUolRfmHyf/uEEXK49y9XMndaxdJjpQirCy4WLCPoe38A4Nez8XySjISU5CFhCIO3k5wUDASkZiUuHj2Z2ahyN5HvuIgRUeOcUZZTOlJJeUlKgbU7Txta0AYbLnFqewMrpSepvhIITm700nblYg8IpJIWRjyiAjiI6JJjJKTGBtHcnwCqYlJpCelkJOWwfe533Jw337Kik9g1N5HqC9RcfyAgvTUPcRHyYmWypCFiJGKQggNDkYsEiEJEhEmCiE8REyYWIJMKiVCEoY8fCcJUTHEx8QgCw0l/8Be/gOTiTiUD46AHAAAAABJRU5ErkJggg==","aspectRatio":1.3333333333333333,"src":"/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png","srcSet":"/static/28e31bfedd96b4afe90237d2c1f700c3/7d89d/Screenshot-from-2022-09-07-18-00-00.png 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f4091/Screenshot-from-2022-09-07-18-00-00.png 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/30481/Screenshot-from-2022-09-07-18-00-00.png 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/33bd6/Screenshot-from-2022-09-07-18-00-00.png 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/d398b/Screenshot-from-2022-09-07-18-00-00.png 316w","srcWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp","srcSetWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/59cda/Screenshot-from-2022-09-07-18-00-00.webp 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/7da75/Screenshot-from-2022-09-07-18-00-00.webp 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f282e/Screenshot-from-2022-09-07-18-00-00.webp 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/a7b21/Screenshot-from-2022-09-07-18-00-00.webp 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/fb2b8/Screenshot-from-2022-09-07-18-00-00.webp 316w","sizes":"(max-width: 110px) 100vw, 110px"}}}},"primary_tag":{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},"tags":[{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"artificial-intelligence","url":"http://localhost:2368/tag/artificial-intelligence/","name":"Artificial Intelligence","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"machine-learning","url":"http://localhost:2368/tag/machine-learning/","name":"Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null}],"plaintext":"In this article , we will talk about SHAP in detail. We will discuss What are Shapley Values ? , Mathematical foundation behind the Shapley Values and How does SHAP (Shapley Additive Explanations) reframes the Shapey Value problem in detail. Also we will discuss What is Local Accuracy, Missingness, and Consistency in the context of explainable models , What is the Shapley Kernel etc.\n\n\nWhat is Shapley Values ?\n\n\nSHAP values were introduced  by Lundberg and Lee (2016) as a way to provide local explanations for machine learning models. They built upon Shapley's work in cooperative game theory, using the Shapley value to explain how each feature in a model contributes to the prediction for a particular instance.\n\nShapley values were invented by Lloyd Shapley as a way of providing a fair solution to the following question: if we have a coalition C that collaborates to produce a value V, how much did each individual member contribute to that final value ?\n\nSo what does this mean ? We have a coalition C, a group of cooperating members that work together to produce some value V, called the coalition value. This could be something like, a corporation of employees that together generate a certain profit, or a dinner group running up a restaurant bill. We want to know exactly how much each member contributed to that final coalition value; what share of the profit does each employee deserve, how much each person in the dinner party owes to settle the bill.\n\n\nHowever, answering this gets tricky when there are interacting effects between members, when certain permutations cause members to contribute more than the sum of their parts. To find a fair answer to this question that takes into account these interaction effects, we can compute the Shapley value for each member of the coalition.\n\nSo let’s how we can compute the Shapley value for member 1 of our example coalition. The way this is done is by sampling a coalition that contains member 1, and then looking at the coalition formed by removing that member.\n\n\nWe then look at the respective values of these two coalitions, and compare the difference between the two.\n\n\nThis difference is the marginal contribution of member 1 to the coalition consisting of members 2, 3, and 4; how much member 1 contributed to that specific group.\n\n\nSo we then enumerate all such pairs of coalitions, that is, all pairs of coalitions that only differ based on whether or not member 1 is included, and then look at all the marginal contributions for each.\n\n\nThe mean marginal contribution is the Shapley value of that member.\n\n\nWe can do this same process for each member of the coalition, and we’ve found a fair solution  to our original question.!\n\nMathematically, the whole process looks like this, but all we need is to know that the Shapley value is the average amount of contribution that a particular member makes to the coalition value.\n\n\nShapley Values To SHAP\n\n\nNow, translating this concept to model explainability is relatively straightforward, and that’s exactly what Scott Lundberg and Su-In Lee did in 2017 with their paper “A Unified Approach to Interpreting Model Predictions,” where they introduced SHAP.\n\n\nSHAP reframes the Shapley value problem from one where we look at how members of a coalition contribute to a coalition value to one where we look at how individual features contribute to a model’s outputs.\n\nThey do this in a very specific way, one that we can get a clue to by looking at the name of their algorithm; Shapley Additive Explanations. We know what Shapley values are, we know what Explanations are, but what do they mean by Additive?\n\n\nLundberg and Lee define an additive feature attribution as follows: if we have a set a of inputs x, and a model f(x), we can define a set of simplified local inputs x’ (which usually means that we turn a feature vector into a discrete binary vector, where features are either included or excluded) and we can also define an explanatory model g.\n\n\nWhat we need to ensure is that One: if x’ is roughly equal to x then g(x’) should be roughly equal to f(x)\n\ntwo: g must take below form, where phi_0 is the null output of the model, that is, the average output of the model, and phi_i is the explained effect of feature_i; how much that feature changes the output of the model. This is called it’s attribution.\n\nIf we have these two, we have an explanatory model that has additive feature attribution. The advantage of this form of explanation is really easy to interpret; we can see the exact contribution and importance of each feature just by looking at the phi values.\n\n\nLocal Accuracy, Missingness and Consistency\n\n\nNow Lundberg and Lee go on to describe a set of three desirable properties of such an additive feature method; local accuracy, missingness, and consistency.\n\n\nLocal Accuracy\n\n\nLocal accuracy : it simply says if the input and the simplified input are roughly the same, then the actual model and the explanatory model should produce roughly the same output.\n\nMissingness\n\n\nMissingness states that if a feature is excluded from the model, it’s attribution must be zero; that is, the only thing that can affect the output of the explanation model is the inclusion of features, not the exclusion.\n\nConsistency\n\n\nFinally, we have consistency (and this one’s a little hard to represent mathematically), but it states that if the original model changes so that the a particular feature’s contribution changes, the attribution in the explanatory model cannot change in the opposite direction;\n\nSo for example, if we have a new model where a specific feature has a more positive contribution than in the original; the attribution in our new explanatory model cannot decrease.\n\nNow while a bunch of different explanation methods satisfy some of these properties, Lundberg and Lee argue that only SHAP satisfies all three; if the feature attributions in our additive explanatory model are specifically chosen to be the shapley values of those features, then all three properties are upheld.\n\n\nShapley Kernel\n\n\nThe problem with SHAP, however, is that computing Shapley values means you have to sample the coalition values for each possible feature permutation, which in a model explainability setting means we have to evaluate our model that number of times.\n\nFor a model that operates over 4 features, it’s easy enough, it’s just 16 coalitions to sample to get all the Shapley values. For 32 features, that’s over 17 billion samples, which is entirely untenable. To get around this, Lundberg and Lee devise the Shapley Kernel, a means of approximating shapley values through much fewer samples.\n\nSo what we do is we pass samples through the model, of various feature permutations of the particular datapoint that we’re trying to explain.\n\nOf course, most ML models won’t just let you omit a feature !\n\n\nSo what we do is define a background dataset B, one that contains a set of representative datapoints that the model was trained over.\n\n\nWe then fill in our omitted feature or features with values from the background dataset, while holding the features that are included in the permutation fixed to their original values.\n\n\nWe then take the average of the model output over all of these new synthetic datapoints as our model output for that feature permutation, which we’ll call that y bar.\n\n\n\nSo once we have a number of samples computed in this way,\n\n\nWe can formulate this as a weighted linear regression, with each feature assigned a coefficient.\n\nWith a very specific choice of weighting for each sample, based on a combination of the total number of features in the model, the number of coalitions with the same number of features as this particular sample, and the number of features included and excluded in this permutation, we ensure that the solution to this weighted linear regression is such that the returned coefficients are equivalent to the Shapley values.\n\nThis weighting scheme is the basis of the Shapley Kernel, and the weighted linear regression process as a whole is Kernel SHAP.\n\nNow, there are a lot of other forms of SHAP that are presented in the paper (Deep SHAP, Low Order SHAP , Max SHAP , Linear SHAP , Tree SHAP etc) , ones that make use of model-specific assumptions and optimizations to speed up the algorithm and the sampling process, but Kernel SHAP is the one among them that is universal and can be applied to any type of machine learning model. This general applicability is why we chose Kernel SHAP as the first form of SHAP to implement for TrustyAI.\n\n\nKernel SHAP Example\n\n\nI’ll run through an example of the Python SHAP implementation provided by Lundberg and Lee. So first I’ll grab a dataset to run our example over, and I’ve picked the Boston housing price dataset, which is a dataset consisting of various attributes about Boston neighborhoods and the corresponding house prices within that neighborhood.\n\nIncomplete. Coming soon","html":"<p>In this article , we will talk about SHAP in detail. We will discuss What are Shapley Values ? , Mathematical foundation behind the Shapley Values and How does SHAP (Shapley Additive Explanations) reframes the Shapey Value problem in detail. Also we will discuss What is Local Accuracy, Missingness, and Consistency in the context of explainable models , What is the Shapley Kernel etc. </p><!--kg-card-begin: markdown--><h3 id=\"what-is-shapley-values\">What is Shapley Values ?</h3>\n<!--kg-card-end: markdown--><p>SHAP values were introduced  by <a href=\"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf\" rel=\"noopener ugc nofollow\">Lundberg and Lee (2016)</a> as a way to provide local explanations for machine learning models. They built upon Shapley's work in cooperative game theory, using the Shapley value to explain how each feature in a model contributes to the prediction for a particular instance.</p><blockquote class=\"kg-blockquote-alt\">Shapley values were invented by Lloyd Shapley as a way of providing a fair solution to the following question: <em>if we have a coalition <strong>C</strong> that collaborates to produce a value <strong>V</strong>, how much did each individual member contribute to that final value ?</em> </blockquote><p>So what does this mean ? We have a coalition C, a group of cooperating members that work together to produce some value V, called the coalition value. This could be something like, a corporation of employees that together generate a certain profit, or a dinner group running up a restaurant bill. We want to know exactly how much each member contributed to that final coalition value; what share of the profit does each employee deserve, how much each person in the dinner party owes to settle the bill.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222118086-efdfcda4-01e6-4d4d-bc6d-30ce019c464b.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"434\"/>\n<!--kg-card-end: markdown--><p>However, answering this gets tricky when there are interacting effects between members, when certain permutations cause members to contribute more than the sum of their parts. <strong><em>To find a fair answer to this question that takes into account these interaction effects, we can compute the Shapley value for each member of the coalition.</em></strong></p><p>So let’s how we can compute the Shapley value for member 1 of our example coalition. The way this is done is by <em>sampling a coalition that contains member 1, and then looking at the coalition formed by removing that member.</em> </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222119980-a7c2c357-eecf-4ea9-8de6-7eefacf4e362.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"404\"/>\n<!--kg-card-end: markdown--><p>We then look at the respective values of these two coalitions, and compare the difference between the two.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222120650-7a9cd97e-3dfd-488c-9a24-45638a75847a.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"512\"/>\n<!--kg-card-end: markdown--><p><em>This difference is the marginal contribution of member 1 to the coalition consisting of members 2, 3, and 4; how much member 1 contributed to that specific group.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222120708-c27b48f7-7712-4e7d-ae44-c998a859215c.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"136\"/>\n<!--kg-card-end: markdown--><p>So we then enumerate all such pairs of coalitions, that is, all pairs of coalitions that only differ based on whether or not member 1 is included, and then look at all the marginal contributions for each. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222121573-e1c9b15d-d883-44f0-b6e3-41fff235ff06.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"333\"/>\n<!--kg-card-end: markdown--><p><em>The mean marginal contribution is the Shapley value of that member.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222121676-1e0e6852-0b66-44b7-bbd4-11fd8e25b39f.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"143\"/>\n<!--kg-card-end: markdown--><p>We can do this same process for each member of the coalition, and we’ve found a fair solution  to our original question.!</p><p>Mathematically, the whole process looks like this, but all we need is to know that the <strong><em>Shapley value is the average amount of contribution that a particular member makes to the coalition value.</em></strong></p><!--kg-card-begin: markdown--><h3 id=\"shapley-values-to-shap\">Shapley Values To SHAP</h3>\n<!--kg-card-end: markdown--><p>Now, translating this concept to model explainability is relatively straightforward, and that’s exactly what Scott Lundberg and Su-In Lee did in 2017 with their paper <a href=\"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf\">“A Unified Approach to Interpreting Model Predictions,”</a> where they introduced SHAP. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222123143-27853042-9e12-4526-91dd-466e04f8a68f.png\" align=\"center\" alt=\"Shapley Paper\" width=\"720\" height=\"666\"/>\n<!--kg-card-end: markdown--><p>SHAP reframes the Shapley value problem from one where we look at <em>how members of a coalition contribute to a coalition value</em> to one where we look at <em>how individual features contribute to a model’s outputs.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222123344-4acf9530-e696-4ee7-80f0-4835cd9cc775.png\" align=\"center\" alt=\"Shapley Paper\" width=\"580\" height=\"352\"/><!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>They do this in a very specific way, one that we can get a clue to by looking at the name of their algorithm; <span style=\"color:red\">Shapley</span> <span style=\"color:blue\">Additive</span> <span style=\"color:green\">Explanations</span>. We know what <span style=\"color:red\">Shapley</span> values are, we know what <span style=\"color:green\">Explanations</span> are, but what do they mean by <span style=\"color:blue\">Additive</span>?</p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>Lundberg and Lee define an additive feature attribution as follows: if we have a set a of <span style=\"color:blue\">inputs x</span>, and <span style=\"color:blue\">a model f(x)</span>, we can define a set of simplified <span style=\"color:green\">local inputs x’</span> (which usually means that we turn a feature vector into a discrete binary vector, where features are either included or excluded) and we can also define an <span style=\"color:green\">explanatory model g</span>.</p>\n<!--kg-card-end: markdown--><p>What we need to ensure is that One: if x’ is roughly equal to x then g(x’) should be roughly equal to f(x)</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222126320-96c62ae5-2dcd-46eb-8a64-38727338c7dd.png\" align=\"center\" alt=\"SHAP\" width=\"404\" height=\"222\"/><!--kg-card-end: markdown--><p>two: g must take below form, where <em>phi_0 is the null output of the model</em>, that is, the average output of the model, and <em>phi_i is the explained effect of feature_i</em>; how much that feature changes the output of the model. <em>This is called it’s attribution.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222126643-5e4a7d98-53a6-4389-86cd-ac6d37041150.png\" align=\"center\" alt=\"SHAP\" width=\"625\" height=\"261\"/><!--kg-card-end: markdown--><p>If we have these two, we have an explanatory model that has additive feature attribution. The advantage of this form of explanation is really easy to interpret; we can see the exact contribution and importance of each feature just by looking at the phi values.</p><!--kg-card-begin: markdown--><h3 id=\"local-accuracy-missingness-and-consistency\">Local Accuracy, Missingness and Consistency</h3>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>Now Lundberg and Lee go on to describe a set of three desirable properties of such an additive feature method; <span style=\"color:red\">local accuracy</span>, <span style=\"color:blue\">missingness</span>, and <span style=\"color:green\">consistency</span>.</p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h4 id=\"local-accuracy\">Local Accuracy</h4>\n<!--kg-card-end: markdown--><p>Local accuracy : it simply says if the input and the simplified input are roughly the same, then the actual model and the explanatory model should produce roughly the same output. </p><!--kg-card-begin: markdown--><h4 id=\"missingness\">Missingness</h4>\n<!--kg-card-end: markdown--><p>Missingness states that if a feature is excluded from the model, it’s attribution must be zero; that is, the only thing that can affect the output of the explanation model is the inclusion of features, not the exclusion. </p><!--kg-card-begin: markdown--><h4 id=\"consistency\">Consistency</h4>\n<!--kg-card-end: markdown--><p>Finally, we have consistency (and this one’s a little hard to represent mathematically), but it states that if the original model changes so that the a particular feature’s contribution changes, the attribution in the explanatory model cannot change in the opposite direction; </p><p>So for example, if we have a new model where a specific feature has a more positive contribution than in the original; the attribution in our new explanatory model cannot decrease. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222395551-04403b51-1e8f-4bbe-84d7-1bb2f9d0b966.png\" align=\"center\" alt=\"SHAP\" width=\"720\" height=\"299\"/><!--kg-card-end: markdown--><p>Now while a bunch of different explanation methods satisfy some of these properties, <em>Lundberg and Lee argue that only SHAP satisfies all three</em>; <strong><em>if the feature attributions in our additive explanatory model are specifically chosen to be the shapley values of those features, then all three properties are upheld.</em></strong></p><!--kg-card-begin: markdown--><h3 id=\"shapley-kernel\">Shapley Kernel</h3>\n<!--kg-card-end: markdown--><p>The problem with SHAP, however, is that computing Shapley values means you have to sample the coalition values for each possible feature permutation, which in a model explainability setting means we have to evaluate our model that number of times. </p><p>For a model that operates over 4 features, it’s easy enough, it’s just 16 coalitions to sample to get all the Shapley values. For 32 features, that’s over 17 billion samples, which is entirely untenable. <em>To get around this, Lundberg and Lee devise the Shapley Kernel, a means of approximating shapley values through much fewer samples.</em></p><p>So what we do is we pass samples through the model, of various feature permutations of the particular datapoint that we’re trying to explain.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222397887-4451072f-be0b-4e27-accc-e401b7ac35bf.png\" align=\"center\" alt=\"Shapley-Permu\" width=\"633\" height=\"407\"/><!--kg-card-end: markdown--><p>Of course, most ML models won’t just let you omit a feature !</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398010-2e845aae-b21e-48ea-b16e-5da41af83b86.png\" align=\"center\" alt=\"Shapley-Omit-Feature\" width=\"588\" height=\"112\"/>\n<!--kg-card-end: markdown--><p>So what we do is define a background dataset B, one that contains a set of representative datapoints that the model was trained over. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398330-d64ddccf-b8f2-4f5e-880a-dfe05d99eb77.png\" align=\"center\" alt=\"BackgroundDataset\" width=\"636\" height=\"239\"/>\n<!--kg-card-end: markdown--><p>We then fill in our omitted feature or features with values from the background dataset, while holding the features that are included in the permutation fixed to their original values.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398831-31f4f53d-2610-47d6-9b45-89a7ff663fe4.png\" align=\"center\" alt=\"IncludedFeaturesFromDatasetB\" width=\"621\" height=\"331\"/>\n<!--kg-card-end: markdown--><p>We then take the average of the model output over all of these new synthetic datapoints as our model output for that feature permutation, which we’ll call that y bar.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399307-fc75df99-27a3-4d11-8fff-d785616fbee9.png\" align=\"center\" alt=\"Shapley-Avg\" width=\"720\" height=\"291\"/>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399733-737c4ba1-23f2-4f97-996e-f3ace97fb3cf.png\" align=\"center\" alt=\"Shapley-ybar\" width=\"683\" height=\"340\"/>\n<!--kg-card-end: markdown--><p>So once we have a number of samples computed in this way, </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399945-9a2510d2-5595-42eb-887c-5b5762c9aa1e.png\" align=\"center\" alt=\"Shapley-NoOfYbar\" width=\"672\" height=\"400\"/>\n<!--kg-card-end: markdown--><p>We can formulate this as a weighted linear regression, with each feature assigned a coefficient.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400421-c3964125-f4d1-44e1-ba12-1231cb76671a.png\" align=\"center\" alt=\"SShapley-LinearReg\" width=\"672\" height=\"400\"/><!--kg-card-end: markdown--><p>With a very specific choice of weighting for each sample, based on a combination of the total number of features in the model, the number of coalitions with the same number of features as this particular sample, and the number of features included and excluded in this permutation, we ensure that the solution to this weighted linear regression is such that the returned coefficients are equivalent to the Shapley values. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400526-11e50df4-880d-44e8-bd15-812560a8e005.png\" align=\"center\" alt=\"Shapley-Weighting\" width=\"720\" height=\"148\"/><!--kg-card-end: markdown--><p>This weighting scheme is the basis of the Shapley Kernel, and the weighted linear regression process as a whole is Kernel SHAP.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400590-c55c9b16-5ce4-4022-a6aa-73c294f2d1a8.png\" align=\"center\" alt=\"Shapley-Kernel-Weights\" width=\"720\" height=\"359\"/><!--kg-card-end: markdown--><p>Now, there are a lot of other forms of SHAP that are presented in the paper (Deep SHAP, Low Order SHAP , Max SHAP , Linear SHAP , Tree SHAP etc) , ones that make use of model-specific assumptions and optimizations to speed up the algorithm and the sampling process, but Kernel SHAP is the one among them that is universal and can be applied to any type of machine learning model. This general applicability is why we chose Kernel SHAP as the first form of SHAP to implement for TrustyAI.</p><!--kg-card-begin: markdown--><h3 id=\"kernel-shap-example\">Kernel SHAP Example</h3>\n<!--kg-card-end: markdown--><p>I’ll run through an example of the Python SHAP implementation provided by Lundberg and Lee. So first I’ll grab a dataset to run our example over, and I’ve picked the Boston housing price dataset, which is a dataset consisting of various attributes about Boston neighborhoods and the corresponding house prices within that neighborhood.</p><p>Incomplete. Coming soon</p>","url":"http://localhost:2368/shapley-additive-explanations-shap/","canonical_url":null,"uuid":"2239e072-7466-4d35-ba08-3fd48b607f1a","codeinjection_foot":null,"codeinjection_head":null,"codeinjection_styles":null,"comment_id":"63ff26ec72a3c427182edd36","reading_time":7,"send_email_when_published":null,"email_subject":null,"childHtmlRehype":{"html":"<p>In this article , we will talk about SHAP in detail. We will discuss What are Shapley Values ? , Mathematical foundation behind the Shapley Values and How does SHAP (Shapley Additive Explanations) reframes the Shapey Value problem in detail. Also we will discuss What is Local Accuracy, Missingness, and Consistency in the context of explainable models , What is the Shapley Kernel etc. </p><!--kg-card-begin: markdown--><h3 id=\"what-is-shapley-values\">What is Shapley Values ?</h3>\n<!--kg-card-end: markdown--><p>SHAP values were introduced  by <a href=\"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf\" rel=\"noopener ugc nofollow\">Lundberg and Lee (2016)</a> as a way to provide local explanations for machine learning models. They built upon Shapley's work in cooperative game theory, using the Shapley value to explain how each feature in a model contributes to the prediction for a particular instance.</p><blockquote class=\"kg-blockquote-alt\">Shapley values were invented by Lloyd Shapley as a way of providing a fair solution to the following question: <em>if we have a coalition <strong>C</strong> that collaborates to produce a value <strong>V</strong>, how much did each individual member contribute to that final value ?</em> </blockquote><p>So what does this mean ? We have a coalition C, a group of cooperating members that work together to produce some value V, called the coalition value. This could be something like, a corporation of employees that together generate a certain profit, or a dinner group running up a restaurant bill. We want to know exactly how much each member contributed to that final coalition value; what share of the profit does each employee deserve, how much each person in the dinner party owes to settle the bill.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222118086-efdfcda4-01e6-4d4d-bc6d-30ce019c464b.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"434\">\n<!--kg-card-end: markdown--><p>However, answering this gets tricky when there are interacting effects between members, when certain permutations cause members to contribute more than the sum of their parts. <strong><em>To find a fair answer to this question that takes into account these interaction effects, we can compute the Shapley value for each member of the coalition.</em></strong></p><p>So let’s how we can compute the Shapley value for member 1 of our example coalition. The way this is done is by <em>sampling a coalition that contains member 1, and then looking at the coalition formed by removing that member.</em> </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222119980-a7c2c357-eecf-4ea9-8de6-7eefacf4e362.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"404\">\n<!--kg-card-end: markdown--><p>We then look at the respective values of these two coalitions, and compare the difference between the two.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222120650-7a9cd97e-3dfd-488c-9a24-45638a75847a.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"512\">\n<!--kg-card-end: markdown--><p><em>This difference is the marginal contribution of member 1 to the coalition consisting of members 2, 3, and 4; how much member 1 contributed to that specific group.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222120708-c27b48f7-7712-4e7d-ae44-c998a859215c.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"136\">\n<!--kg-card-end: markdown--><p>So we then enumerate all such pairs of coalitions, that is, all pairs of coalitions that only differ based on whether or not member 1 is included, and then look at all the marginal contributions for each. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222121573-e1c9b15d-d883-44f0-b6e3-41fff235ff06.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"333\">\n<!--kg-card-end: markdown--><p><em>The mean marginal contribution is the Shapley value of that member.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222121676-1e0e6852-0b66-44b7-bbd4-11fd8e25b39f.png\" align=\"center\" alt=\"Shapley Values\" width=\"720\" height=\"143\">\n<!--kg-card-end: markdown--><p>We can do this same process for each member of the coalition, and we’ve found a fair solution  to our original question.!</p><p>Mathematically, the whole process looks like this, but all we need is to know that the <strong><em>Shapley value is the average amount of contribution that a particular member makes to the coalition value.</em></strong></p><!--kg-card-begin: markdown--><h3 id=\"shapley-values-to-shap\">Shapley Values To SHAP</h3>\n<!--kg-card-end: markdown--><p>Now, translating this concept to model explainability is relatively straightforward, and that’s exactly what Scott Lundberg and Su-In Lee did in 2017 with their paper <a href=\"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf\">“A Unified Approach to Interpreting Model Predictions,”</a> where they introduced SHAP. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222123143-27853042-9e12-4526-91dd-466e04f8a68f.png\" align=\"center\" alt=\"Shapley Paper\" width=\"720\" height=\"666\">\n<!--kg-card-end: markdown--><p>SHAP reframes the Shapley value problem from one where we look at <em>how members of a coalition contribute to a coalition value</em> to one where we look at <em>how individual features contribute to a model’s outputs.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222123344-4acf9530-e696-4ee7-80f0-4835cd9cc775.png\" align=\"center\" alt=\"Shapley Paper\" width=\"580\" height=\"352\"><!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>They do this in a very specific way, one that we can get a clue to by looking at the name of their algorithm; <span style=\"color:red\">Shapley</span> <span style=\"color:blue\">Additive</span> <span style=\"color:green\">Explanations</span>. We know what <span style=\"color:red\">Shapley</span> values are, we know what <span style=\"color:green\">Explanations</span> are, but what do they mean by <span style=\"color:blue\">Additive</span>?</p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>Lundberg and Lee define an additive feature attribution as follows: if we have a set a of <span style=\"color:blue\">inputs x</span>, and <span style=\"color:blue\">a model f(x)</span>, we can define a set of simplified <span style=\"color:green\">local inputs x’</span> (which usually means that we turn a feature vector into a discrete binary vector, where features are either included or excluded) and we can also define an <span style=\"color:green\">explanatory model g</span>.</p>\n<!--kg-card-end: markdown--><p>What we need to ensure is that One: if x’ is roughly equal to x then g(x’) should be roughly equal to f(x)</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222126320-96c62ae5-2dcd-46eb-8a64-38727338c7dd.png\" align=\"center\" alt=\"SHAP\" width=\"404\" height=\"222\"><!--kg-card-end: markdown--><p>two: g must take below form, where <em>phi_0 is the null output of the model</em>, that is, the average output of the model, and <em>phi_i is the explained effect of feature_i</em>; how much that feature changes the output of the model. <em>This is called it’s attribution.</em></p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222126643-5e4a7d98-53a6-4389-86cd-ac6d37041150.png\" align=\"center\" alt=\"SHAP\" width=\"625\" height=\"261\"><!--kg-card-end: markdown--><p>If we have these two, we have an explanatory model that has additive feature attribution. The advantage of this form of explanation is really easy to interpret; we can see the exact contribution and importance of each feature just by looking at the phi values.</p><!--kg-card-begin: markdown--><h3 id=\"local-accuracy-missingness-and-consistency\">Local Accuracy, Missingness and Consistency</h3>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><p>Now Lundberg and Lee go on to describe a set of three desirable properties of such an additive feature method; <span style=\"color:red\">local accuracy</span>, <span style=\"color:blue\">missingness</span>, and <span style=\"color:green\">consistency</span>.</p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><h4 id=\"local-accuracy\">Local Accuracy</h4>\n<!--kg-card-end: markdown--><p>Local accuracy : it simply says if the input and the simplified input are roughly the same, then the actual model and the explanatory model should produce roughly the same output. </p><!--kg-card-begin: markdown--><h4 id=\"missingness\">Missingness</h4>\n<!--kg-card-end: markdown--><p>Missingness states that if a feature is excluded from the model, it’s attribution must be zero; that is, the only thing that can affect the output of the explanation model is the inclusion of features, not the exclusion. </p><!--kg-card-begin: markdown--><h4 id=\"consistency\">Consistency</h4>\n<!--kg-card-end: markdown--><p>Finally, we have consistency (and this one’s a little hard to represent mathematically), but it states that if the original model changes so that the a particular feature’s contribution changes, the attribution in the explanatory model cannot change in the opposite direction; </p><p>So for example, if we have a new model where a specific feature has a more positive contribution than in the original; the attribution in our new explanatory model cannot decrease. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222395551-04403b51-1e8f-4bbe-84d7-1bb2f9d0b966.png\" align=\"center\" alt=\"SHAP\" width=\"720\" height=\"299\"><!--kg-card-end: markdown--><p>Now while a bunch of different explanation methods satisfy some of these properties, <em>Lundberg and Lee argue that only SHAP satisfies all three</em>; <strong><em>if the feature attributions in our additive explanatory model are specifically chosen to be the shapley values of those features, then all three properties are upheld.</em></strong></p><!--kg-card-begin: markdown--><h3 id=\"shapley-kernel\">Shapley Kernel</h3>\n<!--kg-card-end: markdown--><p>The problem with SHAP, however, is that computing Shapley values means you have to sample the coalition values for each possible feature permutation, which in a model explainability setting means we have to evaluate our model that number of times. </p><p>For a model that operates over 4 features, it’s easy enough, it’s just 16 coalitions to sample to get all the Shapley values. For 32 features, that’s over 17 billion samples, which is entirely untenable. <em>To get around this, Lundberg and Lee devise the Shapley Kernel, a means of approximating shapley values through much fewer samples.</em></p><p>So what we do is we pass samples through the model, of various feature permutations of the particular datapoint that we’re trying to explain.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222397887-4451072f-be0b-4e27-accc-e401b7ac35bf.png\" align=\"center\" alt=\"Shapley-Permu\" width=\"633\" height=\"407\"><!--kg-card-end: markdown--><p>Of course, most ML models won’t just let you omit a feature !</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398010-2e845aae-b21e-48ea-b16e-5da41af83b86.png\" align=\"center\" alt=\"Shapley-Omit-Feature\" width=\"588\" height=\"112\">\n<!--kg-card-end: markdown--><p>So what we do is define a background dataset B, one that contains a set of representative datapoints that the model was trained over. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398330-d64ddccf-b8f2-4f5e-880a-dfe05d99eb77.png\" align=\"center\" alt=\"BackgroundDataset\" width=\"636\" height=\"239\">\n<!--kg-card-end: markdown--><p>We then fill in our omitted feature or features with values from the background dataset, while holding the features that are included in the permutation fixed to their original values.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222398831-31f4f53d-2610-47d6-9b45-89a7ff663fe4.png\" align=\"center\" alt=\"IncludedFeaturesFromDatasetB\" width=\"621\" height=\"331\">\n<!--kg-card-end: markdown--><p>We then take the average of the model output over all of these new synthetic datapoints as our model output for that feature permutation, which we’ll call that y bar.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399307-fc75df99-27a3-4d11-8fff-d785616fbee9.png\" align=\"center\" alt=\"Shapley-Avg\" width=\"720\" height=\"291\">\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399733-737c4ba1-23f2-4f97-996e-f3ace97fb3cf.png\" align=\"center\" alt=\"Shapley-ybar\" width=\"683\" height=\"340\">\n<!--kg-card-end: markdown--><p>So once we have a number of samples computed in this way, </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222399945-9a2510d2-5595-42eb-887c-5b5762c9aa1e.png\" align=\"center\" alt=\"Shapley-NoOfYbar\" width=\"672\" height=\"400\">\n<!--kg-card-end: markdown--><p>We can formulate this as a weighted linear regression, with each feature assigned a coefficient.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400421-c3964125-f4d1-44e1-ba12-1231cb76671a.png\" align=\"center\" alt=\"SShapley-LinearReg\" width=\"672\" height=\"400\"><!--kg-card-end: markdown--><p>With a very specific choice of weighting for each sample, based on a combination of the total number of features in the model, the number of coalitions with the same number of features as this particular sample, and the number of features included and excluded in this permutation, we ensure that the solution to this weighted linear regression is such that the returned coefficients are equivalent to the Shapley values. </p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400526-11e50df4-880d-44e8-bd15-812560a8e005.png\" align=\"center\" alt=\"Shapley-Weighting\" width=\"720\" height=\"148\"><!--kg-card-end: markdown--><p>This weighting scheme is the basis of the Shapley Kernel, and the weighted linear regression process as a whole is Kernel SHAP.</p><!--kg-card-begin: markdown--><img src=\"https://user-images.githubusercontent.com/33357428/222400590-c55c9b16-5ce4-4022-a6aa-73c294f2d1a8.png\" align=\"center\" alt=\"Shapley-Kernel-Weights\" width=\"720\" height=\"359\"><!--kg-card-end: markdown--><p>Now, there are a lot of other forms of SHAP that are presented in the paper (Deep SHAP, Low Order SHAP , Max SHAP , Linear SHAP , Tree SHAP etc) , ones that make use of model-specific assumptions and optimizations to speed up the algorithm and the sampling process, but Kernel SHAP is the one among them that is universal and can be applied to any type of machine learning model. This general applicability is why we chose Kernel SHAP as the first form of SHAP to implement for TrustyAI.</p><!--kg-card-begin: markdown--><h3 id=\"kernel-shap-example\">Kernel SHAP Example</h3>\n<!--kg-card-end: markdown--><p>I’ll run through an example of the Python SHAP implementation provided by Lundberg and Lee. So first I’ll grab a dataset to run our example over, and I’ve picked the Boston housing price dataset, which is a dataset consisting of various attributes about Boston neighborhoods and the corresponding house prices within that neighborhood.</p><p>Incomplete. Coming soon</p>","htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this article , we will talk about SHAP in detail. We will discuss What are Shapley Values ? , Mathematical foundation behind the Shapley Values and How does SHAP (Shapley Additive Explanations) reframes the Shapey Value problem in detail. Also we will discuss What is Local Accuracy, Missingness, and Consistency in the context of explainable models , What is the Shapley Kernel etc. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"what-is-shapley-values"},"children":[{"type":"text","value":"What is Shapley Values ?"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"SHAP values were introduced  by "},{"type":"element","tagName":"a","properties":{"href":"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf","rel":["noopener","ugc","nofollow"]},"children":[{"type":"text","value":"Lundberg and Lee (2016)"}]},{"type":"text","value":" as a way to provide local explanations for machine learning models. They built upon Shapley's work in cooperative game theory, using the Shapley value to explain how each feature in a model contributes to the prediction for a particular instance."}]},{"type":"element","tagName":"blockquote","properties":{"className":["kg-blockquote-alt"]},"children":[{"type":"text","value":"Shapley values were invented by Lloyd Shapley as a way of providing a fair solution to the following question: "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"if we have a coalition "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"C"}]},{"type":"text","value":" that collaborates to produce a value "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"V"}]},{"type":"text","value":", how much did each individual member contribute to that final value ?"}]},{"type":"text","value":" "}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So what does this mean ? We have a coalition C, a group of cooperating members that work together to produce some value V, called the coalition value. This could be something like, a corporation of employees that together generate a certain profit, or a dinner group running up a restaurant bill. We want to know exactly how much each member contributed to that final coalition value; what share of the profit does each employee deserve, how much each person in the dinner party owes to settle the bill."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222118086-efdfcda4-01e6-4d4d-bc6d-30ce019c464b.png","align":"center","alt":"Shapley Values","width":720,"height":434},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"However, answering this gets tricky when there are interacting effects between members, when certain permutations cause members to contribute more than the sum of their parts. "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"To find a fair answer to this question that takes into account these interaction effects, we can compute the Shapley value for each member of the coalition."}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So let’s how we can compute the Shapley value for member 1 of our example coalition. The way this is done is by "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"sampling a coalition that contains member 1, and then looking at the coalition formed by removing that member."}]},{"type":"text","value":" "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222119980-a7c2c357-eecf-4ea9-8de6-7eefacf4e362.png","align":"center","alt":"Shapley Values","width":720,"height":404},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We then look at the respective values of these two coalitions, and compare the difference between the two."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222120650-7a9cd97e-3dfd-488c-9a24-45638a75847a.png","align":"center","alt":"Shapley Values","width":720,"height":512},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"This difference is the marginal contribution of member 1 to the coalition consisting of members 2, 3, and 4; how much member 1 contributed to that specific group."}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222120708-c27b48f7-7712-4e7d-ae44-c998a859215c.png","align":"center","alt":"Shapley Values","width":720,"height":136},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So we then enumerate all such pairs of coalitions, that is, all pairs of coalitions that only differ based on whether or not member 1 is included, and then look at all the marginal contributions for each. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222121573-e1c9b15d-d883-44f0-b6e3-41fff235ff06.png","align":"center","alt":"Shapley Values","width":720,"height":333},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"The mean marginal contribution is the Shapley value of that member."}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222121676-1e0e6852-0b66-44b7-bbd4-11fd8e25b39f.png","align":"center","alt":"Shapley Values","width":720,"height":143},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We can do this same process for each member of the coalition, and we’ve found a fair solution  to our original question.!"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Mathematically, the whole process looks like this, but all we need is to know that the "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Shapley value is the average amount of contribution that a particular member makes to the coalition value."}]}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"shapley-values-to-shap"},"children":[{"type":"text","value":"Shapley Values To SHAP"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now, translating this concept to model explainability is relatively straightforward, and that’s exactly what Scott Lundberg and Su-In Lee did in 2017 with their paper "},{"type":"element","tagName":"a","properties":{"href":"https://papers.nips.cc/paper/7062-a-unified-approach-to-interpreting-model-predictions.pdf"},"children":[{"type":"text","value":"“A Unified Approach to Interpreting Model Predictions,”"}]},{"type":"text","value":" where they introduced SHAP. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222123143-27853042-9e12-4526-91dd-466e04f8a68f.png","align":"center","alt":"Shapley Paper","width":720,"height":666},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"SHAP reframes the Shapley value problem from one where we look at "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"how members of a coalition contribute to a coalition value"}]},{"type":"text","value":" to one where we look at "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"how individual features contribute to a model’s outputs."}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222123344-4acf9530-e696-4ee7-80f0-4835cd9cc775.png","align":"center","alt":"Shapley Paper","width":580,"height":352},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"They do this in a very specific way, one that we can get a clue to by looking at the name of their algorithm; "},{"type":"element","tagName":"span","properties":{"style":"color:red"},"children":[{"type":"text","value":"Shapley"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"style":"color:blue"},"children":[{"type":"text","value":"Additive"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"style":"color:green"},"children":[{"type":"text","value":"Explanations"}]},{"type":"text","value":". We know what "},{"type":"element","tagName":"span","properties":{"style":"color:red"},"children":[{"type":"text","value":"Shapley"}]},{"type":"text","value":" values are, we know what "},{"type":"element","tagName":"span","properties":{"style":"color:green"},"children":[{"type":"text","value":"Explanations"}]},{"type":"text","value":" are, but what do they mean by "},{"type":"element","tagName":"span","properties":{"style":"color:blue"},"children":[{"type":"text","value":"Additive"}]},{"type":"text","value":"?"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Lundberg and Lee define an additive feature attribution as follows: if we have a set a of "},{"type":"element","tagName":"span","properties":{"style":"color:blue"},"children":[{"type":"text","value":"inputs x"}]},{"type":"text","value":", and "},{"type":"element","tagName":"span","properties":{"style":"color:blue"},"children":[{"type":"text","value":"a model f(x)"}]},{"type":"text","value":", we can define a set of simplified "},{"type":"element","tagName":"span","properties":{"style":"color:green"},"children":[{"type":"text","value":"local inputs x’"}]},{"type":"text","value":" (which usually means that we turn a feature vector into a discrete binary vector, where features are either included or excluded) and we can also define an "},{"type":"element","tagName":"span","properties":{"style":"color:green"},"children":[{"type":"text","value":"explanatory model g"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"What we need to ensure is that One: if x’ is roughly equal to x then g(x’) should be roughly equal to f(x)"}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222126320-96c62ae5-2dcd-46eb-8a64-38727338c7dd.png","align":"center","alt":"SHAP","width":404,"height":222},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"two: g must take below form, where "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"phi_0 is the null output of the model"}]},{"type":"text","value":", that is, the average output of the model, and "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"phi_i is the explained effect of feature_i"}]},{"type":"text","value":"; how much that feature changes the output of the model. "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"This is called it’s attribution."}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222126643-5e4a7d98-53a6-4389-86cd-ac6d37041150.png","align":"center","alt":"SHAP","width":625,"height":261},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"If we have these two, we have an explanatory model that has additive feature attribution. The advantage of this form of explanation is really easy to interpret; we can see the exact contribution and importance of each feature just by looking at the phi values."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"local-accuracy-missingness-and-consistency"},"children":[{"type":"text","value":"Local Accuracy, Missingness and Consistency"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now Lundberg and Lee go on to describe a set of three desirable properties of such an additive feature method; "},{"type":"element","tagName":"span","properties":{"style":"color:red"},"children":[{"type":"text","value":"local accuracy"}]},{"type":"text","value":", "},{"type":"element","tagName":"span","properties":{"style":"color:blue"},"children":[{"type":"text","value":"missingness"}]},{"type":"text","value":", and "},{"type":"element","tagName":"span","properties":{"style":"color:green"},"children":[{"type":"text","value":"consistency"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h4","properties":{"id":"local-accuracy"},"children":[{"type":"text","value":"Local Accuracy"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Local accuracy : it simply says if the input and the simplified input are roughly the same, then the actual model and the explanatory model should produce roughly the same output. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h4","properties":{"id":"missingness"},"children":[{"type":"text","value":"Missingness"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Missingness states that if a feature is excluded from the model, it’s attribution must be zero; that is, the only thing that can affect the output of the explanation model is the inclusion of features, not the exclusion. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h4","properties":{"id":"consistency"},"children":[{"type":"text","value":"Consistency"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Finally, we have consistency (and this one’s a little hard to represent mathematically), but it states that if the original model changes so that the a particular feature’s contribution changes, the attribution in the explanatory model cannot change in the opposite direction; "}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So for example, if we have a new model where a specific feature has a more positive contribution than in the original; the attribution in our new explanatory model cannot decrease. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222395551-04403b51-1e8f-4bbe-84d7-1bb2f9d0b966.png","align":"center","alt":"SHAP","width":720,"height":299},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now while a bunch of different explanation methods satisfy some of these properties, "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Lundberg and Lee argue that only SHAP satisfies all three"}]},{"type":"text","value":"; "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"if the feature attributions in our additive explanatory model are specifically chosen to be the shapley values of those features, then all three properties are upheld."}]}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"shapley-kernel"},"children":[{"type":"text","value":"Shapley Kernel"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The problem with SHAP, however, is that computing Shapley values means you have to sample the coalition values for each possible feature permutation, which in a model explainability setting means we have to evaluate our model that number of times. "}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For a model that operates over 4 features, it’s easy enough, it’s just 16 coalitions to sample to get all the Shapley values. For 32 features, that’s over 17 billion samples, which is entirely untenable. "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"To get around this, Lundberg and Lee devise the Shapley Kernel, a means of approximating shapley values through much fewer samples."}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So what we do is we pass samples through the model, of various feature permutations of the particular datapoint that we’re trying to explain."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222397887-4451072f-be0b-4e27-accc-e401b7ac35bf.png","align":"center","alt":"Shapley-Permu","width":633,"height":407},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Of course, most ML models won’t just let you omit a feature !"}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222398010-2e845aae-b21e-48ea-b16e-5da41af83b86.png","align":"center","alt":"Shapley-Omit-Feature","width":588,"height":112},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So what we do is define a background dataset B, one that contains a set of representative datapoints that the model was trained over. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222398330-d64ddccf-b8f2-4f5e-880a-dfe05d99eb77.png","align":"center","alt":"BackgroundDataset","width":636,"height":239},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We then fill in our omitted feature or features with values from the background dataset, while holding the features that are included in the permutation fixed to their original values."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222398831-31f4f53d-2610-47d6-9b45-89a7ff663fe4.png","align":"center","alt":"IncludedFeaturesFromDatasetB","width":621,"height":331},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We then take the average of the model output over all of these new synthetic datapoints as our model output for that feature permutation, which we’ll call that y bar."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222399307-fc75df99-27a3-4d11-8fff-d785616fbee9.png","align":"center","alt":"Shapley-Avg","width":720,"height":291},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222399733-737c4ba1-23f2-4f97-996e-f3ace97fb3cf.png","align":"center","alt":"Shapley-ybar","width":683,"height":340},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So once we have a number of samples computed in this way, "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222399945-9a2510d2-5595-42eb-887c-5b5762c9aa1e.png","align":"center","alt":"Shapley-NoOfYbar","width":672,"height":400},"children":[]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We can formulate this as a weighted linear regression, with each feature assigned a coefficient."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222400421-c3964125-f4d1-44e1-ba12-1231cb76671a.png","align":"center","alt":"SShapley-LinearReg","width":672,"height":400},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With a very specific choice of weighting for each sample, based on a combination of the total number of features in the model, the number of coalitions with the same number of features as this particular sample, and the number of features included and excluded in this permutation, we ensure that the solution to this weighted linear regression is such that the returned coefficients are equivalent to the Shapley values. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222400526-11e50df4-880d-44e8-bd15-812560a8e005.png","align":"center","alt":"Shapley-Weighting","width":720,"height":148},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This weighting scheme is the basis of the Shapley Kernel, and the weighted linear regression process as a whole is Kernel SHAP."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/222400590-c55c9b16-5ce4-4022-a6aa-73c294f2d1a8.png","align":"center","alt":"Shapley-Kernel-Weights","width":720,"height":359},"children":[]},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now, there are a lot of other forms of SHAP that are presented in the paper (Deep SHAP, Low Order SHAP , Max SHAP , Linear SHAP , Tree SHAP etc) , ones that make use of model-specific assumptions and optimizations to speed up the algorithm and the sampling process, but Kernel SHAP is the one among them that is universal and can be applied to any type of machine learning model. This general applicability is why we chose Kernel SHAP as the first form of SHAP to implement for TrustyAI."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"kernel-shap-example"},"children":[{"type":"text","value":"Kernel SHAP Example"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"I’ll run through an example of the Python SHAP implementation provided by Lundberg and Lee. So first I’ll grab a dataset to run our example over, and I’ve picked the Boston housing price dataset, which is a dataset consisting of various attributes about Boston neighborhoods and the corresponding house prices within that neighborhood."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Incomplete. Coming soon"}]}],"data":{"quirksMode":false}},"tableOfContents":[{"id":"what-is-shapley-values","heading":"What is Shapley Values ?"},{"id":"shapley-values-to-shap","heading":"Shapley Values To SHAP"},{"id":"local-accuracy-missingness-and-consistency","heading":"Local Accuracy, Missingness and Consistency","items":[{"id":"local-accuracy","heading":"Local Accuracy"},{"id":"missingness","heading":"Missingness"},{"id":"consistency","heading":"Consistency"}]},{"id":"shapley-kernel","heading":"Shapley Kernel"},{"id":"kernel-shap-example","heading":"Kernel SHAP Example"}]},"featureImageSharp":{"base":"photo-1522069213448-443a614da9b6.jpg","publicURL":"/static/c604d810168bc7c01df3faa4bf1a4f00/photo-1522069213448-443a614da9b6.jpg","imageMeta":{"width":2000,"height":1330},"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAMBBf/EABQBAQAAAAAAAAAAAAAAAAAAAAH/2gAMAwEAAhADEAAAAeVsLDEJ/8QAGxAAAgEFAAAAAAAAAAAAAAAAARIDAAIQERP/2gAIAQEAAQUCjXZjK46XJX//xAAWEQADAAAAAAAAAAAAAAAAAAAQESH/2gAIAQMBAT8BiH//xAAUEQEAAAAAAAAAAAAAAAAAAAAQ/9oACAECAQE/AT//xAAYEAADAQEAAAAAAAAAAAAAAAAQEkEAIv/aAAgBAQAGPwLrNCsH/8QAGRABAQADAQAAAAAAAAAAAAAAAREAEIFx/9oACAEBAAE/IQlF7MG/Tm1Lun//2gAMAwEAAgADAAAAEAwP/8QAFhEBAQEAAAAAAAAAAAAAAAAAARAh/9oACAEDAQE/EBwSf//EABYRAQEBAAAAAAAAAAAAAAAAABEBEP/aAAgBAgEBPxArn//EABwQAAICAgMAAAAAAAAAAAAAAAERITEQYQBBwf/aAAgBAQABPxAarAAhquZ4ENRbaNF+Zr1qAFA6x//Z","aspectRatio":1.5028901734104045,"src":"/static/c604d810168bc7c01df3faa4bf1a4f00/d5c54/photo-1522069213448-443a614da9b6.jpg","srcSet":"/static/c604d810168bc7c01df3faa4bf1a4f00/65d8c/photo-1522069213448-443a614da9b6.jpg 260w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/c5f21/photo-1522069213448-443a614da9b6.jpg 520w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/d5c54/photo-1522069213448-443a614da9b6.jpg 1040w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/81a53/photo-1522069213448-443a614da9b6.jpg 1560w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/4e5f3/photo-1522069213448-443a614da9b6.jpg 2000w","srcWebp":"/static/c604d810168bc7c01df3faa4bf1a4f00/e4875/photo-1522069213448-443a614da9b6.webp","srcSetWebp":"/static/c604d810168bc7c01df3faa4bf1a4f00/dc8f3/photo-1522069213448-443a614da9b6.webp 260w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/2db4b/photo-1522069213448-443a614da9b6.webp 520w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/e4875/photo-1522069213448-443a614da9b6.webp 1040w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/f5845/photo-1522069213448-443a614da9b6.webp 1560w,\n/static/c604d810168bc7c01df3faa4bf1a4f00/49d6b/photo-1522069213448-443a614da9b6.webp 2000w","sizes":"(max-width: 1040px) 100vw, 1040px"}}}},"prev":{"id":"Ghost__Post__639aeedafbcf61465c0f70e5","title":"Introduction to Causality In Machine Learning - Part 1","slug":"introduction-to-causality-in-machine-learning","featured":true,"feature_image":"https://images.unsplash.com/photo-1485827404703-89b55fcc595e?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDExfHxtYWNoaW5lJTIwbGVhcm5pbmd8ZW58MHx8fHwxNjcyMTIxMjUz&ixlib=rb-4.0.3&q=80&w=2000","excerpt":"This post is the first of the series on Causal Machine Learning. I will start with the very basics of causal inference in this. Enjoy the reading!","custom_excerpt":"This post is the first of the series on Causal Machine Learning. I will start with the very basics of causal inference in this. Enjoy the reading!","visibility":"public","created_at_pretty":"15 Dec 2022","published_at_pretty":"15 Dec 2022","updated_at_pretty":"5 Jan 2023","created_at":"2022-12-15T15:24:34.000+05:30","published_at":"2022-12-15T15:29:30.000+05:30","updated_at":"2023-01-05T17:34:08.000+05:30","meta_title":null,"meta_description":null,"og_description":null,"og_image":null,"og_title":null,"twitter_description":null,"twitter_image":null,"twitter_title":null,"authors":[{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":null}],"primary_author":{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":{"base":"Screenshot-from-2022-09-07-18-00-00.png","publicURL":"/static/28e31bfedd96b4afe90237d2c1f700c3/Screenshot-from-2022-09-07-18-00-00.png","imageMeta":{"width":316,"height":237},"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEJElEQVQ4yyXO21fTBQDA8d9fUh5LQAW1eEImbIPJbSB3kZtijjSBxNvAGSAqlJZ64GAHIQ0VjkKICCiCQ8cYsYFjYwhsYxeGjJsopmEnH76dYw+f94/w2jmKfaSX9wtTrC1a+bBk5d83dlbnzFhHehnq62TBZeLjGyfvFqf4a9nGstuAx/oM96Qai76NieFu5u0jLLrNCCsOI47nat56J1hbtLH60kTfg5tUV6hQFeSSFLGTgtwcBtUteGc0zLoGmXNpmXU8Yd6txTOlxvq8hzmr/hNhyTaC06hmya3nn6VxHKMPKS08RFF+HgWK/aiO5JP3TQ4xMgn3mqt599bC8pyBRY+OxRkdXkc/rrE+POZ+nMY+hFXHKPPWP5m3a/i4Yqax9kfCREEkyKPJSk3mQFYmOelpRISGEBMuwahv4/WC4dNuwa3l1Us906O9jGs7sWg7EHQdv6NurWVmvJv33iHKTuSyft06tm3xJygwEIlIxDb/zUhFIvw2+HDrxkX+XjUx5x7A6+pn3qXBZnyIoacFTftNhKarlTxprsMz3sPbWR2jmiYiJSICt27lqwB/tmza+L8Af5KkYsYNHXhcvbidahy2x0ya2jFqm7lxqYxrF04jvLQMYB16jKazHrOulRWHjiJFOus/+5yAjX5s8vNhs58vfj5foooO43LJMaovncI1/ZhpWxcTlk6mRjrpa7uOrqsJYcaiY25imKftv6F52IBx4D61Z46y6Yv1+PpsYLOvD36+G0gJDuRcrIS0nTvY8XUAl66osDq60A3e5sHtXzCoW3CY+hHeeKdZdL5gytDDgsOAe1zL9KiawowEsoK2URi+HWWMmKvZuzibKuNcqoTiWBEXShToLHfo7K6h+9413DYzS/MehJnJYZxjOowDHdjHnjE53M2kUU1/zVmu742lOlNOkyKRmtzd1KkUtObFcacgmUetVTT0/kTDvQpemPoxDWmoralG8NrNvJqZwmbS8Xp5FrfNhMtuxtNei75Kia3xAmtdVZgaf6axvprKvXH8kB5FXd1lFMcyuVp7Hnd9E0+bb5Cdvgfhw4oXPq5hGR5kzGzkUVcPVeWlPK8tx/BrCfcrjnI+bx+KPSmcPJxP2QklFUolRfmHyf/uEEXK49y9XMndaxdJjpQirCy4WLCPoe38A4Nez8XySjISU5CFhCIO3k5wUDASkZiUuHj2Z2ahyN5HvuIgRUeOcUZZTOlJJeUlKgbU7Txta0AYbLnFqewMrpSepvhIITm700nblYg8IpJIWRjyiAjiI6JJjJKTGBtHcnwCqYlJpCelkJOWwfe533Jw337Kik9g1N5HqC9RcfyAgvTUPcRHyYmWypCFiJGKQggNDkYsEiEJEhEmCiE8REyYWIJMKiVCEoY8fCcJUTHEx8QgCw0l/8Be/gOTiTiUD46AHAAAAABJRU5ErkJggg==","aspectRatio":1.3333333333333333,"src":"/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png","srcSet":"/static/28e31bfedd96b4afe90237d2c1f700c3/7d89d/Screenshot-from-2022-09-07-18-00-00.png 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f4091/Screenshot-from-2022-09-07-18-00-00.png 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/30481/Screenshot-from-2022-09-07-18-00-00.png 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/33bd6/Screenshot-from-2022-09-07-18-00-00.png 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/d398b/Screenshot-from-2022-09-07-18-00-00.png 316w","srcWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp","srcSetWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/59cda/Screenshot-from-2022-09-07-18-00-00.webp 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/7da75/Screenshot-from-2022-09-07-18-00-00.webp 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f282e/Screenshot-from-2022-09-07-18-00-00.webp 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/a7b21/Screenshot-from-2022-09-07-18-00-00.webp 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/fb2b8/Screenshot-from-2022-09-07-18-00-00.webp 316w","sizes":"(max-width: 110px) 100vw, 110px"}}}},"primary_tag":{"slug":"machine-learning","url":"http://localhost:2368/tag/machine-learning/","name":"Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},"tags":[{"slug":"machine-learning","url":"http://localhost:2368/tag/machine-learning/","name":"Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"artificial-intelligence","url":"http://localhost:2368/tag/artificial-intelligence/","name":"Artificial Intelligence","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"causal-machine-learning","url":"http://localhost:2368/tag/causal-machine-learning/","name":"Causal Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null}],"plaintext":"\n\n\nTo Build Truly Intelligent Machines, Teach Them Cause and Effect.\n\n\n\n\n\n\nCorrelation is not Causation!.\n\n\n\nThis post is the first of the series on Causal Machine Learning. I will start with the very basics of causal inference , Provide some basic background in Bayesian networks/graphical models , Show how graphical models can be used in causal inference and Describe application scenarios , case studies and the practical difficulties in Causal Inference. I will follow step by step approach and keep the things as simple as possible with lot of practical tutorials. In each of the session i will provide additional learning materials and references , which should help you to keep the flow. In this blog post , i will present Why we need causality in Machine Learning! . Enjoy the reading!\n\n\nWhat is Causal AI ?\n\n\nDeep learning techniques do a good job at building models by correlating data points. But many AI researchers believe that more work needs to be done to understand causation and not just correlation. The field causal deep learning -- useful in determining why something happened -- is still in its infancy, and it is much more difficult to automate than neural networks.\n\n\n\n\nEven though we can observe correlation, it does not prove causation.\n\n\n\nCorrelation: measures the relationship between two things.\nCausation: means that one thing will cause the other to happen.\n\n\n\n * \n   \n   \n   I know that when I see X, I will see Y (Association/Correlation)\n   \n   \n\n * \n   \n   \n   I know that X causes Y (Causality)\n   \n   \n\n\nThe distinctions between the two can have important implications. In the website, “Spurious Correlations” by Tyler Vigen, we can explore a wide variety of correlations that are due to chance. One of the interesting spurious correlation is listed below.\n\n\n\n\nWhile these two variables have a correlation of 95.23%, it is highly unrealistic to think that a degree in mathematics caused an increase in the amount of Uranium stored in the United States!\n\n\n\n\n\n\n\n“If Correlation Doesn’t Imply Causation, Then What Does?”\n\n\n\nWe will uncover this in the upcoming blog posts.\n\nThe excitement in the field has been kindled by Judea Pearl, a professor at UCLA, who did some of the formative work on implementing Bayesian networks for statistical analysis. More recently he has been developing a framework for diagramming causation and teasing apart the factors that contribute to observed events in a computable framework.\n\n\n\n\nIn his latest book, “The Book of Why: The New Science of Cause and Effect,” he argues that artificial intelligence has been handicapped by an incomplete understanding of what intelligence really is. In his new book, Pearl, elaborates a vision for how truly intelligent machines would think. The key, he argues, is to replace reasoning by association with causal reasoning. Instead of the mere ability to correlate fever and malaria, machines need the capacity to reason that malaria causes fever. Pearl expects that causal reasoning could provide machines with human-level intelligence.\n\n\n\n\nUnderstanding why requires understanding of the whats, the wheres, and the whens. The hows, however, seem to be an implementation of the whys !!\n\n\nTraditional ML Vs Causal ML\n\n\nMachine learning is a type of artificial intelligence that involves training algorithms to recognise patterns in data and make predictions or decisions based on those patterns. The goal of machine learning is to build models that can generalise to new data and make accurate predictions or decisions.\n\nThe main difference between machine learning and causal machine learning is the focus of the analysis. While traditional machine learning aims to predict an outcome based on patterns in the data, causal machine learning aims to identify the specific variables that are causing an outcome and how they contribute to it. This involves identifying and modelling the causal relationships between variables, rather than just the statistical relationships.\n\nCausal machine learning is a type of machine learning that focuses on identifying the cause-and-effect relationships between variables. In other words, it aims to identify the factors that influence a particular outcome and how they influence it.\n\nCausal machine learning can be used to improve the accuracy of predictive models by taking into account the underlying causes of the outcomes being predicted. It is also useful in a variety of applications, such as evaluating the effectiveness of interventions, predicting the impact of policy changes, and identifying the factors that contribute to certain outcomes.\n\n\nExplainable AI vs Causal AI\n\n\nExplainable AI (XAI) is a type of artificial intelligence (AI) that is designed to be transparent and interpretable, meaning that it can provide explanations for its decisions and actions. The goal of XAI is to make AI systems more transparent and understandable to humans, so that they can be trusted and used more effectively.\n\nCausal AI, on the other hand, is a type of AI that focuses on identifying the cause-and-effect relationships between variables. It is a sub field of machine learning that aims to identify the specific factors that influence a particular outcome and how they contribute to it. One key difference between explainable AI and causal AI is their focus. Explainable AI is concerned with making AI systems more transparent and interpretable, while causal AI is focused on identifying the causes and effects of various phenomena.\n\nAnother difference is the techniques used. Explainable AI often employs techniques such as feature importance, sensitivity analysis, and model interpretation methods to provide insights into the decision-making process of AI systems. Causal AI, on the other hand, typically uses techniques such as structural equation modelling, instrumental variables, and counterfactual analysis to identify the causal relationships between variables.\n\nWhile XAI and causal AI are related in that they both aim to increase our understanding of how AI systems work, they are distinct concepts. XAI focuses on providing explanations for the decisions and predictions made by AI systems, while causal AI focuses on identifying the underlying causes of outcomes.\n\nOne way in which XAI and causal AI can be related is that XAI methods, such as counterfactual analysis, can be used to identify the causes of particular outcomes or decisions. However, it is important to note that not all XAI methods are causal in nature, and not all causal AI systems are necessarily explainable. Overall, both XAI and causal AI are important tools for improving our understanding of how AI systems work and for increasing the transparency and trustworthiness of AI systems.\n\n\nApplications\n\n\nCausal machine learning can be applied in many different fields and industries to identify and understand the causal relationships between variables. Here are a few examples of the application of causal machine learning:\n\n 1. Healthcare: Causal machine learning can be used to identify the factors that contribute to the development of certain diseases and to predict the likelihood of future events, such as hospital re-admissions. It can also be used to understand the factors that influence patient outcomes and to develop personalised treatment plans.\n 2. Finance: Causal machine learning can be used to understand the factors that influence stock prices and to develop trading strategies. It can also be used to identify the causes of financial fraud and to develop strategies to prevent it.\n 3. Marketing: Causal machine learning can be used to understand the factors that influence customer behaviour and to optimize marketing campaigns. It can also be used to identify the factors that drive customer loyalty and to develop strategies to retain customers.\n 4. Education: Causal machine learning can be used to understand the factors that influence student learning and to develop personalized learning strategies. It can also be used to identify the causes of academic achievement gaps and to develop strategies to address them.\n 5. Social science: Causal machine learning can be used to understand the factors that influence social outcomes and to develop policies that address social issues. It can also be used to identify the causes of social inequality and to develop strategies to address it.\n\nThese are just a few examples of the many ways in which causal machine learning can be applied. There are many more applications in various fields and industries.\n\n\nConclusion\n\n\nIn this post I have provided an introduction to Causal machine learning. I have tried to be as compact as possible. Below you can find some additional resources if you want to know more about Causal machine learning. Hope you enjoyed reading so far!.\n\n\nReferences\n\n\n 1. \n    \n    \n    Textbook : Causal Machine Learning - Mannings\n    \n\n 2. \n    \n    \n    Paper : Causal Machine Learning: A Survey and Open Problems, 2022. Jean Kaddour, Aengus Lynch, Qi Liu, Matt J. Kusner, Ricardo Silva.\n    \n\n 3. \n    \n    \n    Workshop : NeurIPS 2021 Workshop\n    \n\n 4. \n    \n    \n    Course : Machine Learning & Causal Inference: A Short Course\n    \n\n 5. \n    \n    \n    Texbook : Causal inference in statistics:An overview. Judea Pearl\n    \n\n 6. \n    \n    \n    Industry : Causality and Machine Learning: Microsoft Research\n    \n","html":"<!--kg-card-begin: markdown--><blockquote>\n<p>To Build Truly Intelligent Machines, Teach Them Cause and Effect.</p>\n</blockquote>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><blockquote>\n<p>Correlation is not Causation!.</p>\n</blockquote>\n<!--kg-card-end: markdown--><p>This post is the first of the series on <a href=\"http://localhost:2368/tag/causal-machine-learning\">Causal Machine Learning</a>. I will start with the very basics of causal inference , Provide some basic background in Bayesian networks/graphical models , Show how graphical models can be used in causal inference and Describe application scenarios , case studies and the practical difficulties in Causal Inference. I will follow step by step approach and keep the things as simple as possible with lot of practical tutorials. In each of the session i will provide additional learning materials and references , which should help you to keep the flow. In this blog post , i will present <em>Why we need causality in Machine Learning! </em>. Enjoy the reading!</p><!--kg-card-begin: markdown--><h3 id=\"what-is-causal-ai\">What is Causal AI ?</h3>\n<!--kg-card-end: markdown--><p>Deep learning techniques do a good job at building models by correlating data points. But many AI researchers believe that more work needs to be done to understand causation and not just correlation. The field causal deep learning -- useful in determining <em>why something happened </em>-- is still in its infancy, and it is much more difficult to automate than neural networks.</p><!--kg-card-begin: markdown--><blockquote>\n<p>Even though we can observe correlation, it does not prove causation.</p>\n</blockquote>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><pre><code>Correlation: measures the relationship between two things.\nCausation: means that one thing will cause the other to happen.\n</code></pre>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><ul>\n<li>\n<pre><code>I know that when I see X, I will see Y (Association/Correlation)\n</code></pre>\n</li>\n<li>\n<pre><code>I know that X causes Y (Causality)\n</code></pre>\n</li>\n</ul>\n<!--kg-card-end: markdown--><p>The distinctions between the two can have important implications. In the website, <a href=\"http://www.tylervigen.com/spurious-correlations\">“Spurious Correlations”</a> by Tyler Vigen, we can explore a wide variety of correlations that are due to chance. One of the interesting spurious correlation is listed below. </p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/209831536-c820c96b-3347-4a30-b0f0-dca9e409e6f0.jpeg\" align=\"center\"\nalt=\"Spurious Correlation Example\" width = \"720\" height=\"283\"></p>\n<!--kg-card-end: markdown--><p>While these two variables have a correlation of 95.23%, <em>it is highly unrealistic to think that a degree in mathematics caused an increase in the amount of Uranium stored in the United States!</em></p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208087796-ad8b5727-8db3-4d71-9881-8a4f56169964.png\" align=\"center\"\nalt=\"CorrelationVsCausation\"></p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><blockquote>\n<p>“If Correlation Doesn’t Imply Causation, Then What Does?”</p>\n</blockquote>\n<!--kg-card-end: markdown--><p>We will uncover this in the upcoming blog posts.</p><p>The excitement in the field has been kindled by Judea Pearl, a professor at UCLA, who did some of the formative work on implementing <a href=\"https://www.techtarget.com/searchenterpriseai/feature/Bayesian-networks-applications-are-fueling-enterprise-support\">Bayesian networks for statistical analysis</a>. More recently he has been developing a framework for diagramming causation and teasing apart the factors that contribute to observed events in a computable framework. </p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208084630-fd654f0e-0bc2-4576-844a-5d398c75d5a8.jpg\" align=\"center\"\nalt=\"The Book Of Why\" width = \"600\" height=\"400\"></p>\n<!--kg-card-end: markdown--><p>In his latest book, “<a href=\"https://www.basicbooks.com/titles/judea-pearl/the-book-of-why/9780465097609/\">The Book of Why: The New Science of Cause and Effect</a>,” he argues that artificial intelligence has been handicapped by an incomplete understanding of what intelligence really is. In his new book, Pearl, elaborates a vision for how truly intelligent machines would think. The key, he argues, is to replace reasoning by association with causal reasoning. <em>Instead of the mere ability to correlate fever and malaria, machines need the capacity to reason that malaria causes fever. </em>Pearl expects that causal reasoning could provide machines with human-level intelligence.</p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208090292-28654bde-487b-4f4e-b1ea-dd957c8ae7f0.jpg\" align=\"center\" alt=\"The Why ?\" height=\n\"400\"/></p>\n<!--kg-card-end: markdown--><p>Understanding <em>why</em> requires understanding of the <em>whats, the wheres, and the whens.</em> The <em>hows</em>, however, seem to be an implementation of the <em>whys !!</em></p><!--kg-card-begin: markdown--><h3 id=\"traditional-ml-vs-causal-ml\">Traditional ML Vs Causal ML</h3>\n<!--kg-card-end: markdown--><p>Machine learning is a type of artificial intelligence that involves training algorithms to recognise patterns in data and make predictions or decisions based on those patterns. The goal of machine learning is to build models that can generalise to new data and make accurate predictions or decisions.</p><p>The main difference between machine learning and causal machine learning is the focus of the analysis. While traditional machine learning aims to predict an outcome based on patterns in the data, causal machine learning aims to identify the specific variables that are causing an outcome and how they contribute to it. This involves identifying and modelling the causal relationships between variables, rather than just the statistical relationships.</p><p>Causal machine learning is a type of machine learning that focuses on identifying the cause-and-effect relationships between variables. In other words, it aims to identify the factors that influence a particular outcome and how they influence it.</p><p>Causal machine learning can be used to improve the accuracy of predictive models by taking into account the underlying causes of the outcomes being predicted. It is also useful in a variety of applications, such as evaluating the effectiveness of interventions, predicting the impact of policy changes, and identifying the factors that contribute to certain outcomes.</p><!--kg-card-begin: markdown--><h3 id=\"explainable-ai-vs-causal-ai\">Explainable AI vs Causal AI</h3>\n<!--kg-card-end: markdown--><p><em>Explainable AI (XAI)</em> is a type of artificial intelligence (AI) that is designed to be transparent and interpretable, meaning that it can provide explanations for its decisions and actions. The goal of XAI is to make AI systems more transparent and understandable to humans, so that they can be trusted and used more effectively.</p><p>Causal AI, on the other hand, is a type of AI that focuses on identifying the cause-and-effect relationships between variables. It is a sub field of machine learning that aims to identify the specific factors that influence a particular outcome and how they contribute to it. One key difference between explainable AI and causal AI is their focus. Explainable AI is concerned with making AI systems more transparent and interpretable, while causal AI is focused on identifying the causes and effects of various phenomena.</p><p>Another difference is the techniques used. Explainable AI often employs techniques such as feature importance, sensitivity analysis, and model interpretation methods to provide insights into the decision-making process of AI systems. Causal AI, on the other hand, typically uses techniques such as structural equation modelling, instrumental variables, and counterfactual analysis to identify the causal relationships between variables.</p><p>While XAI and causal AI are related in that they both aim to increase our understanding of how AI systems work, they are distinct concepts. XAI focuses on providing explanations for the decisions and predictions made by AI systems, while causal AI focuses on identifying the underlying causes of outcomes.</p><p>One way in which XAI and causal AI can be related is that XAI methods, such as counterfactual analysis, can be used to identify the causes of particular outcomes or decisions. However, it is important to note that not all XAI methods are causal in nature, and not all causal AI systems are necessarily explainable. Overall, both XAI and causal AI are important tools for improving our understanding of how AI systems work and for increasing the transparency and trustworthiness of AI systems.</p><!--kg-card-begin: markdown--><h3 id=\"applications\">Applications</h3>\n<!--kg-card-end: markdown--><p>Causal machine learning can be applied in many different fields and industries to identify and understand the causal relationships between variables. Here are a few examples of the application of causal machine learning:</p><ol><li>Healthcare: Causal machine learning can be used to identify the factors that contribute to the development of certain diseases and to predict the likelihood of future events, such as hospital re-admissions. It can also be used to understand the factors that influence patient outcomes and to develop personalised treatment plans.</li><li>Finance: Causal machine learning can be used to understand the factors that influence stock prices and to develop trading strategies. It can also be used to identify the causes of financial fraud and to develop strategies to prevent it.</li><li>Marketing: Causal machine learning can be used to understand the factors that influence customer behaviour and to optimize marketing campaigns. It can also be used to identify the factors that drive customer loyalty and to develop strategies to retain customers.</li><li>Education: Causal machine learning can be used to understand the factors that influence student learning and to develop personalized learning strategies. It can also be used to identify the causes of academic achievement gaps and to develop strategies to address them.</li><li>Social science: Causal machine learning can be used to understand the factors that influence social outcomes and to develop policies that address social issues. It can also be used to identify the causes of social inequality and to develop strategies to address it.</li></ol><p>These are just a few examples of the many ways in which causal machine learning can be applied. There are many more applications in various fields and industries.</p><!--kg-card-begin: markdown--><h3 id=\"conclusion\">Conclusion</h3>\n<!--kg-card-end: markdown--><p>In this post I have provided an introduction to Causal machine learning. I have tried to be as compact as possible. Below you can find some additional resources if you want to know more about Causal machine learning. Hope you enjoyed reading so far!. </p><!--kg-card-begin: markdown--><h3 id=\"references\">References</h3>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><ol>\n<li>\n<p><a href=\"https://www.manning.com/books/causal-machine-learning\">Textbook : Causal Machine Learning - Mannings</a></p>\n</li>\n<li>\n<p><a href=\"https://arxiv.org/abs/2206.15475\">Paper : Causal Machine Learning: A Survey and Open Problems, 2022. Jean Kaddour, Aengus Lynch, Qi Liu, Matt J. Kusner, Ricardo Silva.</a></p>\n</li>\n<li>\n<p><a href=\"https://why21.causalai.net\">Workshop : NeurIPS 2021 Workshop</a></p>\n</li>\n<li>\n<p><a href=\"https://www.youtube.com/playlist?list=PLxq_lXOUlvQAoWZEqhRqHNezS30lI49G-\">Course : Machine Learning &amp; Causal Inference: A Short Course</a></p>\n</li>\n<li>\n<p><a href=\"https://ftp.cs.ucla.edu/pub/stat_ser/r350.pdf\">Texbook : Causal inference in statistics:An overview. Judea Pearl</a></p>\n</li>\n<li>\n<p><a href=\"https://www.microsoft.com/en-us/research/group/causal-inference/#!publications\">Industry : Causality and Machine Learning: Microsoft Research</a></p>\n</li>\n</ol>\n<!--kg-card-end: markdown-->","url":"http://localhost:2368/introduction-to-causality-in-machine-learning/","canonical_url":null,"uuid":"5011289e-f32c-4f7d-8d67-158b64251de8","codeinjection_foot":null,"codeinjection_head":null,"codeinjection_styles":null,"comment_id":"639aeedafbcf61465c0f70e5","reading_time":6,"send_email_when_published":null,"email_subject":null,"childHtmlRehype":{"html":"<!--kg-card-begin: markdown--><blockquote>\n<p>To Build Truly Intelligent Machines, Teach Them Cause and Effect.</p>\n</blockquote>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><blockquote>\n<p>Correlation is not Causation!.</p>\n</blockquote>\n<!--kg-card-end: markdown--><p>This post is the first of the series on <a href=\"/tag/causal-machine-learning\">Causal Machine Learning</a>. I will start with the very basics of causal inference , Provide some basic background in Bayesian networks/graphical models , Show how graphical models can be used in causal inference and Describe application scenarios , case studies and the practical difficulties in Causal Inference. I will follow step by step approach and keep the things as simple as possible with lot of practical tutorials. In each of the session i will provide additional learning materials and references , which should help you to keep the flow. In this blog post , i will present <em>Why we need causality in Machine Learning! </em>. Enjoy the reading!</p><!--kg-card-begin: markdown--><h3 id=\"what-is-causal-ai\">What is Causal AI ?</h3>\n<!--kg-card-end: markdown--><p>Deep learning techniques do a good job at building models by correlating data points. But many AI researchers believe that more work needs to be done to understand causation and not just correlation. The field causal deep learning -- useful in determining <em>why something happened </em>-- is still in its infancy, and it is much more difficult to automate than neural networks.</p><!--kg-card-begin: markdown--><blockquote>\n<p>Even though we can observe correlation, it does not prove causation.</p>\n</blockquote>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><div class=\"kg-card kg-code-card gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">Correlation: measures the relationship between two things.\nCausation: means that one thing will cause the other to happen.\n</code></pre></div>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><ul>\n<li>\n<div class=\"kg-card kg-code-card gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">I know that when I see X, I will see Y (Association/Correlation)\n</code></pre></div>\n</li>\n<li>\n<div class=\"kg-card kg-code-card gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">I know that X causes Y (Causality)\n</code></pre></div>\n</li>\n</ul>\n<!--kg-card-end: markdown--><p>The distinctions between the two can have important implications. In the website, <a href=\"http://www.tylervigen.com/spurious-correlations\">“Spurious Correlations”</a> by Tyler Vigen, we can explore a wide variety of correlations that are due to chance. One of the interesting spurious correlation is listed below. </p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/209831536-c820c96b-3347-4a30-b0f0-dca9e409e6f0.jpeg\" align=\"center\" alt=\"Spurious Correlation Example\" width=\"720\" height=\"283\"></p>\n<!--kg-card-end: markdown--><p>While these two variables have a correlation of 95.23%, <em>it is highly unrealistic to think that a degree in mathematics caused an increase in the amount of Uranium stored in the United States!</em></p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208087796-ad8b5727-8db3-4d71-9881-8a4f56169964.png\" align=\"center\" alt=\"CorrelationVsCausation\"></p>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><blockquote>\n<p>“If Correlation Doesn’t Imply Causation, Then What Does?”</p>\n</blockquote>\n<!--kg-card-end: markdown--><p>We will uncover this in the upcoming blog posts.</p><p>The excitement in the field has been kindled by Judea Pearl, a professor at UCLA, who did some of the formative work on implementing <a href=\"https://www.techtarget.com/searchenterpriseai/feature/Bayesian-networks-applications-are-fueling-enterprise-support\">Bayesian networks for statistical analysis</a>. More recently he has been developing a framework for diagramming causation and teasing apart the factors that contribute to observed events in a computable framework. </p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208084630-fd654f0e-0bc2-4576-844a-5d398c75d5a8.jpg\" align=\"center\" alt=\"The Book Of Why\" width=\"600\" height=\"400\"></p>\n<!--kg-card-end: markdown--><p>In his latest book, “<a href=\"https://www.basicbooks.com/titles/judea-pearl/the-book-of-why/9780465097609/\">The Book of Why: The New Science of Cause and Effect</a>,” he argues that artificial intelligence has been handicapped by an incomplete understanding of what intelligence really is. In his new book, Pearl, elaborates a vision for how truly intelligent machines would think. The key, he argues, is to replace reasoning by association with causal reasoning. <em>Instead of the mere ability to correlate fever and malaria, machines need the capacity to reason that malaria causes fever. </em>Pearl expects that causal reasoning could provide machines with human-level intelligence.</p><!--kg-card-begin: markdown--><p><img src=\"https://user-images.githubusercontent.com/33357428/208090292-28654bde-487b-4f4e-b1ea-dd957c8ae7f0.jpg\" align=\"center\" alt=\"The Why ?\" height=\"400\"></p>\n<!--kg-card-end: markdown--><p>Understanding <em>why</em> requires understanding of the <em>whats, the wheres, and the whens.</em> The <em>hows</em>, however, seem to be an implementation of the <em>whys !!</em></p><!--kg-card-begin: markdown--><h3 id=\"traditional-ml-vs-causal-ml\">Traditional ML Vs Causal ML</h3>\n<!--kg-card-end: markdown--><p>Machine learning is a type of artificial intelligence that involves training algorithms to recognise patterns in data and make predictions or decisions based on those patterns. The goal of machine learning is to build models that can generalise to new data and make accurate predictions or decisions.</p><p>The main difference between machine learning and causal machine learning is the focus of the analysis. While traditional machine learning aims to predict an outcome based on patterns in the data, causal machine learning aims to identify the specific variables that are causing an outcome and how they contribute to it. This involves identifying and modelling the causal relationships between variables, rather than just the statistical relationships.</p><p>Causal machine learning is a type of machine learning that focuses on identifying the cause-and-effect relationships between variables. In other words, it aims to identify the factors that influence a particular outcome and how they influence it.</p><p>Causal machine learning can be used to improve the accuracy of predictive models by taking into account the underlying causes of the outcomes being predicted. It is also useful in a variety of applications, such as evaluating the effectiveness of interventions, predicting the impact of policy changes, and identifying the factors that contribute to certain outcomes.</p><!--kg-card-begin: markdown--><h3 id=\"explainable-ai-vs-causal-ai\">Explainable AI vs Causal AI</h3>\n<!--kg-card-end: markdown--><p><em>Explainable AI (XAI)</em> is a type of artificial intelligence (AI) that is designed to be transparent and interpretable, meaning that it can provide explanations for its decisions and actions. The goal of XAI is to make AI systems more transparent and understandable to humans, so that they can be trusted and used more effectively.</p><p>Causal AI, on the other hand, is a type of AI that focuses on identifying the cause-and-effect relationships between variables. It is a sub field of machine learning that aims to identify the specific factors that influence a particular outcome and how they contribute to it. One key difference between explainable AI and causal AI is their focus. Explainable AI is concerned with making AI systems more transparent and interpretable, while causal AI is focused on identifying the causes and effects of various phenomena.</p><p>Another difference is the techniques used. Explainable AI often employs techniques such as feature importance, sensitivity analysis, and model interpretation methods to provide insights into the decision-making process of AI systems. Causal AI, on the other hand, typically uses techniques such as structural equation modelling, instrumental variables, and counterfactual analysis to identify the causal relationships between variables.</p><p>While XAI and causal AI are related in that they both aim to increase our understanding of how AI systems work, they are distinct concepts. XAI focuses on providing explanations for the decisions and predictions made by AI systems, while causal AI focuses on identifying the underlying causes of outcomes.</p><p>One way in which XAI and causal AI can be related is that XAI methods, such as counterfactual analysis, can be used to identify the causes of particular outcomes or decisions. However, it is important to note that not all XAI methods are causal in nature, and not all causal AI systems are necessarily explainable. Overall, both XAI and causal AI are important tools for improving our understanding of how AI systems work and for increasing the transparency and trustworthiness of AI systems.</p><!--kg-card-begin: markdown--><h3 id=\"applications\">Applications</h3>\n<!--kg-card-end: markdown--><p>Causal machine learning can be applied in many different fields and industries to identify and understand the causal relationships between variables. Here are a few examples of the application of causal machine learning:</p><ol><li>Healthcare: Causal machine learning can be used to identify the factors that contribute to the development of certain diseases and to predict the likelihood of future events, such as hospital re-admissions. It can also be used to understand the factors that influence patient outcomes and to develop personalised treatment plans.</li><li>Finance: Causal machine learning can be used to understand the factors that influence stock prices and to develop trading strategies. It can also be used to identify the causes of financial fraud and to develop strategies to prevent it.</li><li>Marketing: Causal machine learning can be used to understand the factors that influence customer behaviour and to optimize marketing campaigns. It can also be used to identify the factors that drive customer loyalty and to develop strategies to retain customers.</li><li>Education: Causal machine learning can be used to understand the factors that influence student learning and to develop personalized learning strategies. It can also be used to identify the causes of academic achievement gaps and to develop strategies to address them.</li><li>Social science: Causal machine learning can be used to understand the factors that influence social outcomes and to develop policies that address social issues. It can also be used to identify the causes of social inequality and to develop strategies to address it.</li></ol><p>These are just a few examples of the many ways in which causal machine learning can be applied. There are many more applications in various fields and industries.</p><!--kg-card-begin: markdown--><h3 id=\"conclusion\">Conclusion</h3>\n<!--kg-card-end: markdown--><p>In this post I have provided an introduction to Causal machine learning. I have tried to be as compact as possible. Below you can find some additional resources if you want to know more about Causal machine learning. Hope you enjoyed reading so far!. </p><!--kg-card-begin: markdown--><h3 id=\"references\">References</h3>\n<!--kg-card-end: markdown--><!--kg-card-begin: markdown--><ol>\n<li>\n<p><a href=\"https://www.manning.com/books/causal-machine-learning\">Textbook : Causal Machine Learning - Mannings</a></p>\n</li>\n<li>\n<p><a href=\"https://arxiv.org/abs/2206.15475\">Paper : Causal Machine Learning: A Survey and Open Problems, 2022. Jean Kaddour, Aengus Lynch, Qi Liu, Matt J. Kusner, Ricardo Silva.</a></p>\n</li>\n<li>\n<p><a href=\"https://why21.causalai.net\">Workshop : NeurIPS 2021 Workshop</a></p>\n</li>\n<li>\n<p><a href=\"https://www.youtube.com/playlist?list=PLxq_lXOUlvQAoWZEqhRqHNezS30lI49G-\">Course : Machine Learning &#x26; Causal Inference: A Short Course</a></p>\n</li>\n<li>\n<p><a href=\"https://ftp.cs.ucla.edu/pub/stat_ser/r350.pdf\">Texbook : Causal inference in statistics:An overview. Judea Pearl</a></p>\n</li>\n<li>\n<p><a href=\"https://www.microsoft.com/en-us/research/group/causal-inference/#!publications\">Industry : Causality and Machine Learning: Microsoft Research</a></p>\n</li>\n</ol>\n<!--kg-card-end: markdown-->","htmlAst":{"type":"root","children":[{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To Build Truly Intelligent Machines, Teach Them Cause and Effect."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Correlation is not Causation!."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This post is the first of the series on "},{"type":"element","tagName":"a","properties":{"href":"/tag/causal-machine-learning"},"children":[{"type":"text","value":"Causal Machine Learning"}]},{"type":"text","value":". I will start with the very basics of causal inference , Provide some basic background in Bayesian networks/graphical models , Show how graphical models can be used in causal inference and Describe application scenarios , case studies and the practical difficulties in Causal Inference. I will follow step by step approach and keep the things as simple as possible with lot of practical tutorials. In each of the session i will provide additional learning materials and references , which should help you to keep the flow. In this blog post , i will present "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Why we need causality in Machine Learning! "}]},{"type":"text","value":". Enjoy the reading!"}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"what-is-causal-ai"},"children":[{"type":"text","value":"What is Causal AI ?"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Deep learning techniques do a good job at building models by correlating data points. But many AI researchers believe that more work needs to be done to understand causation and not just correlation. The field causal deep learning -- useful in determining "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"why something happened "}]},{"type":"text","value":"-- is still in its infancy, and it is much more difficult to automate than neural networks."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Even though we can observe correlation, it does not prove causation."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"div","properties":{"className":["kg-card","kg-code-card","gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"Correlation: measures the relationship between two things.\nCausation: means that one thing will cause the other to happen.\n"}]}]}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["kg-card","kg-code-card","gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"I know that when I see X, I will see Y (Association/Correlation)\n"}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["kg-card","kg-code-card","gatsby-highlight"],"dataLanguage":"text"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-text"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-text"]},"children":[{"type":"text","value":"I know that X causes Y (Causality)\n"}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The distinctions between the two can have important implications. In the website, "},{"type":"element","tagName":"a","properties":{"href":"http://www.tylervigen.com/spurious-correlations"},"children":[{"type":"text","value":"“Spurious Correlations”"}]},{"type":"text","value":" by Tyler Vigen, we can explore a wide variety of correlations that are due to chance. One of the interesting spurious correlation is listed below. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/209831536-c820c96b-3347-4a30-b0f0-dca9e409e6f0.jpeg","align":"center","alt":"Spurious Correlation Example","width":720,"height":283},"children":[]}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"While these two variables have a correlation of 95.23%, "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"it is highly unrealistic to think that a degree in mathematics caused an increase in the amount of Uranium stored in the United States!"}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/208087796-ad8b5727-8db3-4d71-9881-8a4f56169964.png","align":"center","alt":"CorrelationVsCausation"},"children":[]}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"“If Correlation Doesn’t Imply Causation, Then What Does?”"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We will uncover this in the upcoming blog posts."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The excitement in the field has been kindled by Judea Pearl, a professor at UCLA, who did some of the formative work on implementing "},{"type":"element","tagName":"a","properties":{"href":"https://www.techtarget.com/searchenterpriseai/feature/Bayesian-networks-applications-are-fueling-enterprise-support"},"children":[{"type":"text","value":"Bayesian networks for statistical analysis"}]},{"type":"text","value":". More recently he has been developing a framework for diagramming causation and teasing apart the factors that contribute to observed events in a computable framework. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/208084630-fd654f0e-0bc2-4576-844a-5d398c75d5a8.jpg","align":"center","alt":"The Book Of Why","width":600,"height":400},"children":[]}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In his latest book, “"},{"type":"element","tagName":"a","properties":{"href":"https://www.basicbooks.com/titles/judea-pearl/the-book-of-why/9780465097609/"},"children":[{"type":"text","value":"The Book of Why: The New Science of Cause and Effect"}]},{"type":"text","value":",” he argues that artificial intelligence has been handicapped by an incomplete understanding of what intelligence really is. In his new book, Pearl, elaborates a vision for how truly intelligent machines would think. The key, he argues, is to replace reasoning by association with causal reasoning. "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Instead of the mere ability to correlate fever and malaria, machines need the capacity to reason that malaria causes fever. "}]},{"type":"text","value":"Pearl expects that causal reasoning could provide machines with human-level intelligence."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"img","properties":{"src":"https://user-images.githubusercontent.com/33357428/208090292-28654bde-487b-4f4e-b1ea-dd957c8ae7f0.jpg","align":"center","alt":"The Why ?","height":400},"children":[]}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Understanding "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"why"}]},{"type":"text","value":" requires understanding of the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"whats, the wheres, and the whens."}]},{"type":"text","value":" The "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"hows"}]},{"type":"text","value":", however, seem to be an implementation of the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"whys !!"}]}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"traditional-ml-vs-causal-ml"},"children":[{"type":"text","value":"Traditional ML Vs Causal ML"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Machine learning is a type of artificial intelligence that involves training algorithms to recognise patterns in data and make predictions or decisions based on those patterns. The goal of machine learning is to build models that can generalise to new data and make accurate predictions or decisions."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The main difference between machine learning and causal machine learning is the focus of the analysis. While traditional machine learning aims to predict an outcome based on patterns in the data, causal machine learning aims to identify the specific variables that are causing an outcome and how they contribute to it. This involves identifying and modelling the causal relationships between variables, rather than just the statistical relationships."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Causal machine learning is a type of machine learning that focuses on identifying the cause-and-effect relationships between variables. In other words, it aims to identify the factors that influence a particular outcome and how they influence it."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Causal machine learning can be used to improve the accuracy of predictive models by taking into account the underlying causes of the outcomes being predicted. It is also useful in a variety of applications, such as evaluating the effectiveness of interventions, predicting the impact of policy changes, and identifying the factors that contribute to certain outcomes."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"explainable-ai-vs-causal-ai"},"children":[{"type":"text","value":"Explainable AI vs Causal AI"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Explainable AI (XAI)"}]},{"type":"text","value":" is a type of artificial intelligence (AI) that is designed to be transparent and interpretable, meaning that it can provide explanations for its decisions and actions. The goal of XAI is to make AI systems more transparent and understandable to humans, so that they can be trusted and used more effectively."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Causal AI, on the other hand, is a type of AI that focuses on identifying the cause-and-effect relationships between variables. It is a sub field of machine learning that aims to identify the specific factors that influence a particular outcome and how they contribute to it. One key difference between explainable AI and causal AI is their focus. Explainable AI is concerned with making AI systems more transparent and interpretable, while causal AI is focused on identifying the causes and effects of various phenomena."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Another difference is the techniques used. Explainable AI often employs techniques such as feature importance, sensitivity analysis, and model interpretation methods to provide insights into the decision-making process of AI systems. Causal AI, on the other hand, typically uses techniques such as structural equation modelling, instrumental variables, and counterfactual analysis to identify the causal relationships between variables."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"While XAI and causal AI are related in that they both aim to increase our understanding of how AI systems work, they are distinct concepts. XAI focuses on providing explanations for the decisions and predictions made by AI systems, while causal AI focuses on identifying the underlying causes of outcomes."}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"One way in which XAI and causal AI can be related is that XAI methods, such as counterfactual analysis, can be used to identify the causes of particular outcomes or decisions. However, it is important to note that not all XAI methods are causal in nature, and not all causal AI systems are necessarily explainable. Overall, both XAI and causal AI are important tools for improving our understanding of how AI systems work and for increasing the transparency and trustworthiness of AI systems."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"applications"},"children":[{"type":"text","value":"Applications"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Causal machine learning can be applied in many different fields and industries to identify and understand the causal relationships between variables. Here are a few examples of the application of causal machine learning:"}]},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Healthcare: Causal machine learning can be used to identify the factors that contribute to the development of certain diseases and to predict the likelihood of future events, such as hospital re-admissions. It can also be used to understand the factors that influence patient outcomes and to develop personalised treatment plans."}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Finance: Causal machine learning can be used to understand the factors that influence stock prices and to develop trading strategies. It can also be used to identify the causes of financial fraud and to develop strategies to prevent it."}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Marketing: Causal machine learning can be used to understand the factors that influence customer behaviour and to optimize marketing campaigns. It can also be used to identify the factors that drive customer loyalty and to develop strategies to retain customers."}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Education: Causal machine learning can be used to understand the factors that influence student learning and to develop personalized learning strategies. It can also be used to identify the causes of academic achievement gaps and to develop strategies to address them."}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Social science: Causal machine learning can be used to understand the factors that influence social outcomes and to develop policies that address social issues. It can also be used to identify the causes of social inequality and to develop strategies to address it."}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"These are just a few examples of the many ways in which causal machine learning can be applied. There are many more applications in various fields and industries."}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"conclusion"},"children":[{"type":"text","value":"Conclusion"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this post I have provided an introduction to Causal machine learning. I have tried to be as compact as possible. Below you can find some additional resources if you want to know more about Causal machine learning. Hope you enjoyed reading so far!. "}]},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"h3","properties":{"id":"references"},"children":[{"type":"text","value":"References"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"},{"type":"comment","value":"kg-card-begin: markdown"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://www.manning.com/books/causal-machine-learning"},"children":[{"type":"text","value":"Textbook : Causal Machine Learning - Mannings"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://arxiv.org/abs/2206.15475"},"children":[{"type":"text","value":"Paper : Causal Machine Learning: A Survey and Open Problems, 2022. Jean Kaddour, Aengus Lynch, Qi Liu, Matt J. Kusner, Ricardo Silva."}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://why21.causalai.net"},"children":[{"type":"text","value":"Workshop : NeurIPS 2021 Workshop"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://www.youtube.com/playlist?list=PLxq_lXOUlvQAoWZEqhRqHNezS30lI49G-"},"children":[{"type":"text","value":"Course : Machine Learning & Causal Inference: A Short Course"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://ftp.cs.ucla.edu/pub/stat_ser/r350.pdf"},"children":[{"type":"text","value":"Texbook : Causal inference in statistics:An overview. Judea Pearl"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"https://www.microsoft.com/en-us/research/group/causal-inference/#!publications"},"children":[{"type":"text","value":"Industry : Causality and Machine Learning: Microsoft Research"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"comment","value":"kg-card-end: markdown"}],"data":{"quirksMode":false}},"tableOfContents":[{"id":"what-is-causal-ai","heading":"What is Causal AI ?"},{"id":"traditional-ml-vs-causal-ml","heading":"Traditional ML Vs Causal ML"},{"id":"explainable-ai-vs-causal-ai","heading":"Explainable AI vs Causal AI"},{"id":"applications","heading":"Applications"},{"id":"conclusion","heading":"Conclusion"},{"id":"references","heading":"References"}]},"featureImageSharp":{"base":"photo-1485827404703-89b55fcc595e.jpg","publicURL":"/static/c78765cdf66c1694378ee695d13229c5/photo-1485827404703-89b55fcc595e.jpg","imageMeta":{"width":2000,"height":1333},"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAABQD/xAAVAQEBAAAAAAAAAAAAAAAAAAACAf/aAAwDAQACEAMQAAABMTNSNNnIv//EABkQAAIDAQAAAAAAAAAAAAAAAAEDAAIRE//aAAgBAQABBQIV2FdLoyKMZbilOFX/xAAVEQEBAAAAAAAAAAAAAAAAAAAAEf/aAAgBAwEBPwFX/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAHBAAAQQDAQAAAAAAAAAAAAAAAQACITEDEBES/9oACAEBAAY/AlUt2PAnImngpf/EABwQAAMAAQUAAAAAAAAAAAAAAAABESExUWGB0f/aAAgBAQABPyFSSclqoRceDzGPrBdOWo27Bm6z2H//2gAMAwEAAgADAAAAEPTP/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAERUf/aAAgBAwEBPxBuQnD/xAAWEQEBAQAAAAAAAAAAAAAAAAABABH/2gAIAQIBAT8QDbG//8QAHRABAAMAAgMBAAAAAAAAAAAAAQARITFhQXGhwf/aAAgBAQABPxBE7CgOuJYFeFaVwPkKvqbtjgZaove/kG2kH+DauVJYvOpl/J//2Q==","aspectRatio":1.4957264957264957,"src":"/static/c78765cdf66c1694378ee695d13229c5/ea4ab/photo-1485827404703-89b55fcc595e.jpg","srcSet":"/static/c78765cdf66c1694378ee695d13229c5/477ba/photo-1485827404703-89b55fcc595e.jpg 175w,\n/static/c78765cdf66c1694378ee695d13229c5/06776/photo-1485827404703-89b55fcc595e.jpg 350w,\n/static/c78765cdf66c1694378ee695d13229c5/ea4ab/photo-1485827404703-89b55fcc595e.jpg 700w,\n/static/c78765cdf66c1694378ee695d13229c5/3055e/photo-1485827404703-89b55fcc595e.jpg 1050w,\n/static/c78765cdf66c1694378ee695d13229c5/eff08/photo-1485827404703-89b55fcc595e.jpg 1400w,\n/static/c78765cdf66c1694378ee695d13229c5/4e5f3/photo-1485827404703-89b55fcc595e.jpg 2000w","srcWebp":"/static/c78765cdf66c1694378ee695d13229c5/89afa/photo-1485827404703-89b55fcc595e.webp","srcSetWebp":"/static/c78765cdf66c1694378ee695d13229c5/9fca7/photo-1485827404703-89b55fcc595e.webp 175w,\n/static/c78765cdf66c1694378ee695d13229c5/37a4e/photo-1485827404703-89b55fcc595e.webp 350w,\n/static/c78765cdf66c1694378ee695d13229c5/89afa/photo-1485827404703-89b55fcc595e.webp 700w,\n/static/c78765cdf66c1694378ee695d13229c5/78e7a/photo-1485827404703-89b55fcc595e.webp 1050w,\n/static/c78765cdf66c1694378ee695d13229c5/03d34/photo-1485827404703-89b55fcc595e.webp 1400w,\n/static/c78765cdf66c1694378ee695d13229c5/49d6b/photo-1485827404703-89b55fcc595e.webp 2000w","sizes":"(max-width: 700px) 100vw, 700px"}}}},"next":{"id":"Ghost__Post__63eeea8172a3c427182edcc0","title":"Explaining Bayesian Neural Networks","slug":"explaining-bayesian-neural-networks","featured":false,"feature_image":"https://images.unsplash.com/photo-1646583288948-24548aedffd8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDc2fHxhaXxlbnwwfHx8fDE2NzY2MDIwNTY&ixlib=rb-4.0.3&q=80&w=2000","excerpt":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","custom_excerpt":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","visibility":"public","created_at_pretty":"17 Feb 2023","published_at_pretty":"17 Feb 2023","updated_at_pretty":"17 Feb 2023","created_at":"2023-02-17T08:16:25.000+05:30","published_at":"2023-02-17T08:22:35.000+05:30","updated_at":"2023-02-17T08:23:09.000+05:30","meta_title":null,"meta_description":null,"og_description":null,"og_image":null,"og_title":null,"twitter_description":null,"twitter_image":null,"twitter_title":null,"authors":[{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":null}],"primary_author":{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":{"base":"Screenshot-from-2022-09-07-18-00-00.png","publicURL":"/static/28e31bfedd96b4afe90237d2c1f700c3/Screenshot-from-2022-09-07-18-00-00.png","imageMeta":{"width":316,"height":237},"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEJElEQVQ4yyXO21fTBQDA8d9fUh5LQAW1eEImbIPJbSB3kZtijjSBxNvAGSAqlJZ64GAHIQ0VjkKICCiCQ8cYsYFjYwhsYxeGjJsopmEnH76dYw+f94/w2jmKfaSX9wtTrC1a+bBk5d83dlbnzFhHehnq62TBZeLjGyfvFqf4a9nGstuAx/oM96Qai76NieFu5u0jLLrNCCsOI47nat56J1hbtLH60kTfg5tUV6hQFeSSFLGTgtwcBtUteGc0zLoGmXNpmXU8Yd6txTOlxvq8hzmr/hNhyTaC06hmya3nn6VxHKMPKS08RFF+HgWK/aiO5JP3TQ4xMgn3mqt599bC8pyBRY+OxRkdXkc/rrE+POZ+nMY+hFXHKPPWP5m3a/i4Yqax9kfCREEkyKPJSk3mQFYmOelpRISGEBMuwahv4/WC4dNuwa3l1Us906O9jGs7sWg7EHQdv6NurWVmvJv33iHKTuSyft06tm3xJygwEIlIxDb/zUhFIvw2+HDrxkX+XjUx5x7A6+pn3qXBZnyIoacFTftNhKarlTxprsMz3sPbWR2jmiYiJSICt27lqwB/tmza+L8Af5KkYsYNHXhcvbidahy2x0ya2jFqm7lxqYxrF04jvLQMYB16jKazHrOulRWHjiJFOus/+5yAjX5s8vNhs58vfj5foooO43LJMaovncI1/ZhpWxcTlk6mRjrpa7uOrqsJYcaiY25imKftv6F52IBx4D61Z46y6Yv1+PpsYLOvD36+G0gJDuRcrIS0nTvY8XUAl66osDq60A3e5sHtXzCoW3CY+hHeeKdZdL5gytDDgsOAe1zL9KiawowEsoK2URi+HWWMmKvZuzibKuNcqoTiWBEXShToLHfo7K6h+9413DYzS/MehJnJYZxjOowDHdjHnjE53M2kUU1/zVmu742lOlNOkyKRmtzd1KkUtObFcacgmUetVTT0/kTDvQpemPoxDWmoralG8NrNvJqZwmbS8Xp5FrfNhMtuxtNei75Kia3xAmtdVZgaf6axvprKvXH8kB5FXd1lFMcyuVp7Hnd9E0+bb5Cdvgfhw4oXPq5hGR5kzGzkUVcPVeWlPK8tx/BrCfcrjnI+bx+KPSmcPJxP2QklFUolRfmHyf/uEEXK49y9XMndaxdJjpQirCy4WLCPoe38A4Nez8XySjISU5CFhCIO3k5wUDASkZiUuHj2Z2ahyN5HvuIgRUeOcUZZTOlJJeUlKgbU7Txta0AYbLnFqewMrpSepvhIITm700nblYg8IpJIWRjyiAjiI6JJjJKTGBtHcnwCqYlJpCelkJOWwfe533Jw337Kik9g1N5HqC9RcfyAgvTUPcRHyYmWypCFiJGKQggNDkYsEiEJEhEmCiE8REyYWIJMKiVCEoY8fCcJUTHEx8QgCw0l/8Be/gOTiTiUD46AHAAAAABJRU5ErkJggg==","aspectRatio":1.3333333333333333,"src":"/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png","srcSet":"/static/28e31bfedd96b4afe90237d2c1f700c3/7d89d/Screenshot-from-2022-09-07-18-00-00.png 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f4091/Screenshot-from-2022-09-07-18-00-00.png 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/30481/Screenshot-from-2022-09-07-18-00-00.png 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/33bd6/Screenshot-from-2022-09-07-18-00-00.png 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/d398b/Screenshot-from-2022-09-07-18-00-00.png 316w","srcWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp","srcSetWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/59cda/Screenshot-from-2022-09-07-18-00-00.webp 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/7da75/Screenshot-from-2022-09-07-18-00-00.webp 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f282e/Screenshot-from-2022-09-07-18-00-00.webp 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/a7b21/Screenshot-from-2022-09-07-18-00-00.webp 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/fb2b8/Screenshot-from-2022-09-07-18-00-00.webp 316w","sizes":"(max-width: 110px) 100vw, 110px"}}}},"primary_tag":{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},"tags":[{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"artificial-intelligence","url":"http://localhost:2368/tag/artificial-intelligence/","name":"Artificial Intelligence","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"machine-learning","url":"http://localhost:2368/tag/machine-learning/","name":"Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null}],"plaintext":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","html":"<p>Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.</p>","url":"http://localhost:2368/explaining-bayesian-neural-networks/","canonical_url":null,"uuid":"6bef7972-5e59-4ea0-8ccd-99292bb992ab","codeinjection_foot":null,"codeinjection_head":null,"codeinjection_styles":null,"comment_id":"63eeea8172a3c427182edcc0","reading_time":0,"send_email_when_published":null,"email_subject":null,"childHtmlRehype":{"html":"<p>Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.</p>","htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models."}]}],"data":{"quirksMode":false}},"tableOfContents":[]},"featureImageSharp":{"base":"photo-1646583288948-24548aedffd8.jpg","publicURL":"/static/e6860d2b93d53230bfd7e05394764440/photo-1646583288948-24548aedffd8.jpg","imageMeta":{"width":2000,"height":1333},"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIDAQT/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABTnWKSMD/xAAYEAEBAQEBAAAAAAAAAAAAAAABAAIDEP/aAAgBAQABBQJbrlyS2lfP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGBAAAgMAAAAAAAAAAAAAAAAAAAERIEH/2gAIAQEABj8CJe1//8QAGRAAAgMBAAAAAAAAAAAAAAAAAAEQETEh/9oACAEBAAE/IeYkoD0ZRqOP/9oADAMBAAIAAwAAABDPP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABwQAQEBAAEFAAAAAAAAAAAAAAERABAhMUFRYf/aAAgBAQABPxAaswSgie+peDzmEip9blb33//Z","aspectRatio":1.4957264957264957,"src":"/static/e6860d2b93d53230bfd7e05394764440/ea4ab/photo-1646583288948-24548aedffd8.jpg","srcSet":"/static/e6860d2b93d53230bfd7e05394764440/477ba/photo-1646583288948-24548aedffd8.jpg 175w,\n/static/e6860d2b93d53230bfd7e05394764440/06776/photo-1646583288948-24548aedffd8.jpg 350w,\n/static/e6860d2b93d53230bfd7e05394764440/ea4ab/photo-1646583288948-24548aedffd8.jpg 700w,\n/static/e6860d2b93d53230bfd7e05394764440/3055e/photo-1646583288948-24548aedffd8.jpg 1050w,\n/static/e6860d2b93d53230bfd7e05394764440/eff08/photo-1646583288948-24548aedffd8.jpg 1400w,\n/static/e6860d2b93d53230bfd7e05394764440/4e5f3/photo-1646583288948-24548aedffd8.jpg 2000w","srcWebp":"/static/e6860d2b93d53230bfd7e05394764440/89afa/photo-1646583288948-24548aedffd8.webp","srcSetWebp":"/static/e6860d2b93d53230bfd7e05394764440/9fca7/photo-1646583288948-24548aedffd8.webp 175w,\n/static/e6860d2b93d53230bfd7e05394764440/37a4e/photo-1646583288948-24548aedffd8.webp 350w,\n/static/e6860d2b93d53230bfd7e05394764440/89afa/photo-1646583288948-24548aedffd8.webp 700w,\n/static/e6860d2b93d53230bfd7e05394764440/78e7a/photo-1646583288948-24548aedffd8.webp 1050w,\n/static/e6860d2b93d53230bfd7e05394764440/03d34/photo-1646583288948-24548aedffd8.webp 1400w,\n/static/e6860d2b93d53230bfd7e05394764440/49d6b/photo-1646583288948-24548aedffd8.webp 2000w","sizes":"(max-width: 700px) 100vw, 700px"}}}},"allGhostPost":{"edges":[{"node":{"id":"Ghost__Post__63eeea8172a3c427182edcc0","title":"Explaining Bayesian Neural Networks","slug":"explaining-bayesian-neural-networks","featured":false,"feature_image":"https://images.unsplash.com/photo-1646583288948-24548aedffd8?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxMTc3M3wwfDF8c2VhcmNofDc2fHxhaXxlbnwwfHx8fDE2NzY2MDIwNTY&ixlib=rb-4.0.3&q=80&w=2000","excerpt":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","custom_excerpt":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","visibility":"public","created_at_pretty":"17 Feb 2023","published_at_pretty":"17 Feb 2023","updated_at_pretty":"17 Feb 2023","created_at":"2023-02-17T08:16:25.000+05:30","published_at":"2023-02-17T08:22:35.000+05:30","updated_at":"2023-02-17T08:23:09.000+05:30","meta_title":null,"meta_description":null,"og_description":null,"og_image":null,"og_title":null,"twitter_description":null,"twitter_image":null,"twitter_title":null,"authors":[{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":null}],"primary_author":{"slug":"amaljith","url":"http://localhost:2368/author/amaljith/","name":"Amaljith","bio":"Research Scholar @ IIT Kharagpur","cover_image":null,"profile_image":"http://localhost:2368/content/images/2022/09/Screenshot-from-2022-09-07-18-00-00.png","location":null,"website":null,"twitter":null,"facebook":null,"meta_title":null,"meta_description":null,"coverImageSharp":null,"profileImageSharp":{"base":"Screenshot-from-2022-09-07-18-00-00.png","publicURL":"/static/28e31bfedd96b4afe90237d2c1f700c3/Screenshot-from-2022-09-07-18-00-00.png","imageMeta":{"width":316,"height":237},"childImageSharp":{"fluid":{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAEJElEQVQ4yyXO21fTBQDA8d9fUh5LQAW1eEImbIPJbSB3kZtijjSBxNvAGSAqlJZ64GAHIQ0VjkKICCiCQ8cYsYFjYwhsYxeGjJsopmEnH76dYw+f94/w2jmKfaSX9wtTrC1a+bBk5d83dlbnzFhHehnq62TBZeLjGyfvFqf4a9nGstuAx/oM96Qai76NieFu5u0jLLrNCCsOI47nat56J1hbtLH60kTfg5tUV6hQFeSSFLGTgtwcBtUteGc0zLoGmXNpmXU8Yd6txTOlxvq8hzmr/hNhyTaC06hmya3nn6VxHKMPKS08RFF+HgWK/aiO5JP3TQ4xMgn3mqt599bC8pyBRY+OxRkdXkc/rrE+POZ+nMY+hFXHKPPWP5m3a/i4Yqax9kfCREEkyKPJSk3mQFYmOelpRISGEBMuwahv4/WC4dNuwa3l1Us906O9jGs7sWg7EHQdv6NurWVmvJv33iHKTuSyft06tm3xJygwEIlIxDb/zUhFIvw2+HDrxkX+XjUx5x7A6+pn3qXBZnyIoacFTftNhKarlTxprsMz3sPbWR2jmiYiJSICt27lqwB/tmza+L8Af5KkYsYNHXhcvbidahy2x0ya2jFqm7lxqYxrF04jvLQMYB16jKazHrOulRWHjiJFOus/+5yAjX5s8vNhs58vfj5foooO43LJMaovncI1/ZhpWxcTlk6mRjrpa7uOrqsJYcaiY25imKftv6F52IBx4D61Z46y6Yv1+PpsYLOvD36+G0gJDuRcrIS0nTvY8XUAl66osDq60A3e5sHtXzCoW3CY+hHeeKdZdL5gytDDgsOAe1zL9KiawowEsoK2URi+HWWMmKvZuzibKuNcqoTiWBEXShToLHfo7K6h+9413DYzS/MehJnJYZxjOowDHdjHnjE53M2kUU1/zVmu742lOlNOkyKRmtzd1KkUtObFcacgmUetVTT0/kTDvQpemPoxDWmoralG8NrNvJqZwmbS8Xp5FrfNhMtuxtNei75Kia3xAmtdVZgaf6axvprKvXH8kB5FXd1lFMcyuVp7Hnd9E0+bb5Cdvgfhw4oXPq5hGR5kzGzkUVcPVeWlPK8tx/BrCfcrjnI+bx+KPSmcPJxP2QklFUolRfmHyf/uEEXK49y9XMndaxdJjpQirCy4WLCPoe38A4Nez8XySjISU5CFhCIO3k5wUDASkZiUuHj2Z2ahyN5HvuIgRUeOcUZZTOlJJeUlKgbU7Txta0AYbLnFqewMrpSepvhIITm700nblYg8IpJIWRjyiAjiI6JJjJKTGBtHcnwCqYlJpCelkJOWwfe533Jw337Kik9g1N5HqC9RcfyAgvTUPcRHyYmWypCFiJGKQggNDkYsEiEJEhEmCiE8REyYWIJMKiVCEoY8fCcJUTHEx8QgCw0l/8Be/gOTiTiUD46AHAAAAABJRU5ErkJggg==","aspectRatio":1.3333333333333333,"src":"/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png","srcSet":"/static/28e31bfedd96b4afe90237d2c1f700c3/7d89d/Screenshot-from-2022-09-07-18-00-00.png 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f4091/Screenshot-from-2022-09-07-18-00-00.png 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/6ccb0/Screenshot-from-2022-09-07-18-00-00.png 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/30481/Screenshot-from-2022-09-07-18-00-00.png 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/33bd6/Screenshot-from-2022-09-07-18-00-00.png 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/d398b/Screenshot-from-2022-09-07-18-00-00.png 316w","srcWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp","srcSetWebp":"/static/28e31bfedd96b4afe90237d2c1f700c3/59cda/Screenshot-from-2022-09-07-18-00-00.webp 28w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/7da75/Screenshot-from-2022-09-07-18-00-00.webp 55w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/8678c/Screenshot-from-2022-09-07-18-00-00.webp 110w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/f282e/Screenshot-from-2022-09-07-18-00-00.webp 165w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/a7b21/Screenshot-from-2022-09-07-18-00-00.webp 220w,\n/static/28e31bfedd96b4afe90237d2c1f700c3/fb2b8/Screenshot-from-2022-09-07-18-00-00.webp 316w","sizes":"(max-width: 110px) 100vw, 110px"}}}},"primary_tag":{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},"tags":[{"slug":"explainable-ai","url":"http://localhost:2368/tag/explainable-ai/","name":"Explainable AI","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"artificial-intelligence","url":"http://localhost:2368/tag/artificial-intelligence/","name":"Artificial Intelligence","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null},{"slug":"machine-learning","url":"http://localhost:2368/tag/machine-learning/","name":"Machine Learning","visibility":"public","feature_image":null,"description":null,"meta_title":null,"meta_description":null,"featureImageSharp":null}],"plaintext":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.","html":"<p>Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.</p>","url":"http://localhost:2368/explaining-bayesian-neural-networks/","canonical_url":null,"uuid":"6bef7972-5e59-4ea0-8ccd-99292bb992ab","codeinjection_foot":null,"codeinjection_head":null,"codeinjection_styles":null,"comment_id":"63eeea8172a3c427182edcc0","reading_time":0,"send_email_when_published":null,"email_subject":null,"childHtmlRehype":{"html":"<p>Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models.</p>","htmlAst":{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Explainable AI refers to models that can easily be interpreted by humans. Bayesian inferencing is a natural choice to obtain explanations of trained deep learning models."}]}],"data":{"quirksMode":false}},"tableOfContents":[]},"featureImageSharp":{"base":"photo-1646583288948-24548aedffd8.jpg","publicURL":"/static/e6860d2b93d53230bfd7e05394764440/photo-1646583288948-24548aedffd8.jpg","imageMeta":{"width":2000,"height":1333},"childImageSharp":{"fluid":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAIDAQT/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAABTnWKSMD/xAAYEAEBAQEBAAAAAAAAAAAAAAABAAIDEP/aAAgBAQABBQJbrlyS2lfP/8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAwEBPwE//8QAFBEBAAAAAAAAAAAAAAAAAAAAEP/aAAgBAgEBPwE//8QAGBAAAgMAAAAAAAAAAAAAAAAAAAERIEH/2gAIAQEABj8CJe1//8QAGRAAAgMBAAAAAAAAAAAAAAAAAAEQETEh/9oACAEBAAE/IeYkoD0ZRqOP/9oADAMBAAIAAwAAABDPP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8QP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8QP//EABwQAQEBAAEFAAAAAAAAAAAAAAERABAhMUFRYf/aAAgBAQABPxAaswSgie+peDzmEip9blb33//Z","aspectRatio":1.4957264957264957,"src":"/static/e6860d2b93d53230bfd7e05394764440/ea4ab/photo-1646583288948-24548aedffd8.jpg","srcSet":"/static/e6860d2b93d53230bfd7e05394764440/477ba/photo-1646583288948-24548aedffd8.jpg 175w,\n/static/e6860d2b93d53230bfd7e05394764440/06776/photo-1646583288948-24548aedffd8.jpg 350w,\n/static/e6860d2b93d53230bfd7e05394764440/ea4ab/photo-1646583288948-24548aedffd8.jpg 700w,\n/static/e6860d2b93d53230bfd7e05394764440/3055e/photo-1646583288948-24548aedffd8.jpg 1050w,\n/static/e6860d2b93d53230bfd7e05394764440/eff08/photo-1646583288948-24548aedffd8.jpg 1400w,\n/static/e6860d2b93d53230bfd7e05394764440/4e5f3/photo-1646583288948-24548aedffd8.jpg 2000w","srcWebp":"/static/e6860d2b93d53230bfd7e05394764440/89afa/photo-1646583288948-24548aedffd8.webp","srcSetWebp":"/static/e6860d2b93d53230bfd7e05394764440/9fca7/photo-1646583288948-24548aedffd8.webp 175w,\n/static/e6860d2b93d53230bfd7e05394764440/37a4e/photo-1646583288948-24548aedffd8.webp 350w,\n/static/e6860d2b93d53230bfd7e05394764440/89afa/photo-1646583288948-24548aedffd8.webp 700w,\n/static/e6860d2b93d53230bfd7e05394764440/78e7a/photo-1646583288948-24548aedffd8.webp 1050w,\n/static/e6860d2b93d53230bfd7e05394764440/03d34/photo-1646583288948-24548aedffd8.webp 1400w,\n/static/e6860d2b93d53230bfd7e05394764440/49d6b/photo-1646583288948-24548aedffd8.webp 2000w","sizes":"(max-width: 700px) 100vw, 700px"}}}}}]}},"pageContext":{"slug":"shapley-additive-explanations-shap","prev":"introduction-to-causality-in-machine-learning","next":"explaining-bayesian-neural-networks","tag":"explainable-ai","limit":3,"skip":0,"primaryTagCount":2,"collectionPaths":{}}},"staticQueryHashes":["1272700106","1676991999","2138873178","2546165603","2681841279","2938721187","293880488","3052966952","4156497161"]}